Skip to content

Instantly share code, notes, and snippets.

@sin-to-jin
Last active January 6, 2020 13:42
Show Gist options
  • Select an option

  • Save sin-to-jin/07a309df85570b9a333afceccc3a10cd to your computer and use it in GitHub Desktop.

Select an option

Save sin-to-jin/07a309df85570b9a333afceccc3a10cd to your computer and use it in GitHub Desktop.
let test1; // undefined
let test2 = null; // null
const check = val => val ? 'ok' : 'ng';
check(false); // 'ng'
check(0); // 'ng'
check(""); // 'ng'
check(NaN); // 'ng'
check(null); // 'ng'
check(undefined); //'ng'
['Ruby', 'Python', 'JavaScript'].forEach((val, index, array) => {
console.log('111' + val);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment