Skip to content

Instantly share code, notes, and snippets.

@erdoganoksuz
Last active August 20, 2019 08:31
Show Gist options
  • Save erdoganoksuz/c33d0afcc95bb080aeda8925ec37cbf8 to your computer and use it in GitHub Desktop.
Save erdoganoksuz/c33d0afcc95bb080aeda8925ec37cbf8 to your computer and use it in GitHub Desktop.
const list = ["yey", "wuw"];
list.valueOf = () => "JAVASCRIPT SO EASY!";
if (Array.isArray(list)) console.log("IM AN ARRAY")
if (list.some(val => val === "yey")) console.log("YEY EXIST")
if(list == "JAVASCRIPT SO EASY!"){
list.valueOf = () => 1;
console.log("IM ALSO STRING")
}
if(1 == list) console.log("IM ALSO NUMBER")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment