Skip to content

Instantly share code, notes, and snippets.

@krfong916
Created August 8, 2018 23:03
Show Gist options
  • Save krfong916/6d7f99d5e10967c4f80d6243879a1d35 to your computer and use it in GitHub Desktop.
Save krfong916/6d7f99d5e10967c4f80d6243879a1d35 to your computer and use it in GitHub Desktop.
// source http://jsbin.com
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
// Demonstrates why we should not use typeof === 'object'
var bar = [];
var test = (/[^abc]+/g);
var thump = null
console.log(typeof bar === 'object');
console.log(typeof test === 'object');
console.log(typeof thump === 'object');
</script>
<script id="jsbin-source-javascript" type="text/javascript">// Demonstrates why we should not use typeof === 'object'
var bar = [];
var test = (/[^abc]+/g);
var thump = null
console.log(typeof bar === 'object');
console.log(typeof test === 'object');
console.log(typeof thump === 'object');</script></body>
</html>
// Demonstrates why we should not use typeof === 'object'
var bar = [];
var test = (/[^abc]+/g);
var thump = null
console.log(typeof bar === 'object');
console.log(typeof test === 'object');
console.log(typeof thump === 'object');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment