Created
July 12, 2020 14:05
-
-
Save infinitbility/ba0f69d4d519cac89744a1e805e0f6fe to your computer and use it in GitHub Desktop.
Revisions
-
infinitbility created this gist
Jul 12, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ //indexOf example var fruits = ['Banana', 'Blackcurrant', 'Blueberry', 'Chili pepper', 'Cranberry', 'Eggplant', 'Gooseberry']; // You get their index ( Key ) var index = fruits.indexOf('Blueberry'); // output 2 // if value not available var index = fruits.indexOf('Apple'); // output -1