Skip to content

Instantly share code, notes, and snippets.

@jsejcksn
Created October 29, 2016 03:04
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 jsejcksn/259f22e686d2d2502d6bcf4e534bdeb5 to your computer and use it in GitHub Desktop.
Save jsejcksn/259f22e686d2d2502d6bcf4e534bdeb5 to your computer and use it in GitHub Desktop.
const console = {
log: (msg) => {
const para = document.createElement('p');
para.insertAdjacentHTML('beforeend', msg);
document.body.insertAdjacentElement('beforeend', para);
}
};
const space = ' ';
const empty = '';
const str = 'string';
const num = 42;
console.log(isNaN(space)); // false
console.log(isNaN(empty)); // false
console.log(isNaN(str)); // true
console.log(isNaN(num)); // false
console.log(+space); // 0
console.log(+empty); // 0
console.log(+str); // NaN
console.log(+num); // 42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment