Skip to content

Instantly share code, notes, and snippets.

@AmeliaBriscoe
Created September 11, 2018 22:49
Show Gist options
  • Save AmeliaBriscoe/ee146bba23b518fc774f90a2b1fadd8c to your computer and use it in GitHub Desktop.
Save AmeliaBriscoe/ee146bba23b518fc774f90a2b1fadd8c to your computer and use it in GitHub Desktop.
JS Bin 1.2.10 - Strong v Weak Typing and typeof // source https://jsbin.com/jiturin
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="1.2.10 - Strong v Weak Typing and typeof">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
/********************************
* Weak / Loose Typing in
* JavaScript
* 1.2.10.1
*
*******************************/
// var container = 'Text';
// console.log( typeof container );
// container = 2;
// console.log( typeof container );
/********************************
* More Weak Typing in
* JavaScript
* 1.2.10.2
*
*******************************/
// var container = 'Text';
// console.log( typeof container );
// container = 2;
// console.log( typeof container );
// container = true;
// console.log( typeof container );
// container = { id: 1, title: 'Hello' };
// console.log( typeof container );
</script>
<script id="jsbin-source-javascript" type="text/javascript">/********************************
* Weak / Loose Typing in
* JavaScript
* 1.2.10.1
*
*******************************/
// var container = 'Text';
// console.log( typeof container );
// container = 2;
// console.log( typeof container );
/********************************
* More Weak Typing in
* JavaScript
* 1.2.10.2
*
*******************************/
// var container = 'Text';
// console.log( typeof container );
// container = 2;
// console.log( typeof container );
// container = true;
// console.log( typeof container );
// container = { id: 1, title: 'Hello' };
// console.log( typeof container );
</script></body>
</html>
/********************************
* Weak / Loose Typing in
* JavaScript
* 1.2.10.1
*
*******************************/
// var container = 'Text';
// console.log( typeof container );
// container = 2;
// console.log( typeof container );
/********************************
* More Weak Typing in
* JavaScript
* 1.2.10.2
*
*******************************/
// var container = 'Text';
// console.log( typeof container );
// container = 2;
// console.log( typeof container );
// container = true;
// console.log( typeof container );
// container = { id: 1, title: 'Hello' };
// console.log( typeof container );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment