Skip to content

Instantly share code, notes, and snippets.

@sevperez
Created August 8, 2018 16:12
Show Gist options
  • Save sevperez/298c24a45d860c0c1d8cbc0a2c299c8a to your computer and use it in GitHub Desktop.
Save sevperez/298c24a45d860c0c1d8cbc0a2c299c8a to your computer and use it in GitHub Desktop.
// Implicit
console.log("20" + 18); // Logs: 2018
console.log("20" * 18); // Logs: 360
console.log(20 + true); // Logs: 21
console.log("20" == 20); // Logs: true
console.log("20" === 20); // Logs: false
// Explicit
console.log(Number("20") + 18); // Logs: 38
console.log(String(20) + String(true)); // Logs: "20true"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment