This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>A weird dropdown :D</title> | |
| <link rel="stylesheet" href="dropdown.css"> | |
| </head> | |
| <body> | |
| <div class="dropdown"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function just() { | |
| return 'nothing'; | |
| } | |
| console.log( just.name ); | |
| // 'just' | |
| console.log( just.apply() ); | |
| // 'nothing' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var knowing = 'infinite'; | |
| console.log( knowing.length ); | |
| // result: 8 | |
| var intellect = knowing.slice(2); | |
| console.log(intellect); | |
| // result: 'finite' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var infinity = 10.01; | |
| var ten = infinity.toPrecision(2); | |
| console.log(ten); | |
| // result: 10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var date = new Date(); | |
| var dateString = date.toUTCString(); | |
| console.log(dateString); | |
| // 'Thu, 14 Jun 2018 05:37:29 GMT' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // creating a sketch | |
| class Thing { | |
| constructor(givenColor, givenAge) { | |
| this.color = givenColor; | |
| this.age = givenAge; | |
| } | |
| whisper() { | |
| console.log(this.age + ' years ago...'); | |
| console.log(this.color + '...'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var theTree = { | |
| name : 'Divine' , | |
| age : 1001 , | |
| produce() { | |
| return '108 fruits'; | |
| }, | |
| whisper() { | |
| console.log(this.age + ' years ago...'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var theTree = { | |
| name : 'Divine' , | |
| age : 1001 , | |
| produce() { | |
| return '108 fruits'; | |
| } | |
| }; | |
| console.log( theTree.name ); // 'Divine' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var box = 'outer'; | |
| function just() { | |
| // var box = 'inner'; | |
| console.log(box); | |
| } | |
| just(); | |
| // result: 'outer' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function just() { | |
| var box = 'something'; | |
| } | |
| console.log(box); | |
| // result: undefined |