Created
July 14, 2020 04:16
-
-
Save sayham-sjb/1601b754fc33ca8aa6ba6c106eff1238 to your computer and use it in GitHub Desktop.
Alternative of .includes() #js
This file contains 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 characters
function includes(arr, value) { | |
var returnValue = false; | |
var pos = arr.indexOf(value); | |
if (pos >= 0) { | |
returnValue = true; | |
} | |
return returnValue; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment