Skip to content

Instantly share code, notes, and snippets.

@sayham-sjb
Created July 14, 2020 04:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sayham-sjb/1601b754fc33ca8aa6ba6c106eff1238 to your computer and use it in GitHub Desktop.
Save sayham-sjb/1601b754fc33ca8aa6ba6c106eff1238 to your computer and use it in GitHub Desktop.
Alternative of .includes() #js
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