😶🌫️
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
| Modernizr.addTest('marquee', function() { | |
| return typeof document.createElement('marquee').stop === 'function'; | |
| }); | |
| Modernizr.load({ | |
| test: Modernizr.marquee, | |
| nope: '/path/to/marquee.js' | |
| }); |
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 sayColor = function (name) { | |
| color = name(); | |
| return "Red" + color; | |
| } | |
| (function () { | |
| return "Green"; | |
| })(); |
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 Person = function(name) { | |
| this.name = name; | |
| } | |
| Person.prototype.sayHello = function() { | |
| console.log('Hello, my name is ' + this.name); | |
| } |
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
| amplify.request.define('get-hole-scores', 'ajax', { | |
| url: '/game/scores/{mode}/{id}', | |
| dataType: 'json', | |
| type: 'GET', | |
| cache: 1000, | |
| decoder: function (data, status, xhr, success, error) { | |
| for (var i = 0, il = data.length; i < il; i++) { | |
| data[i].CompletedAt = new Date(parseInt(data[i].CompletedAt.match(dateRegex)[1], 10)); | |
| data[i].completionDate = formatDate(data[i].CompletedAt); | |
| } |
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 x() { | |
| console.log(typeof this); | |
| return this; | |
| } | |
| console.log(x.call(2) === 2); |
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 Person(name, age) { | |
| this.name = name; | |
| this.age = age; | |
| }; | |
| function Employee(name, age, company, jobTitle) { | |
| Person.call(this, company, jobTitle); | |
| this.company = company; | |
| this.jobTitle = jobTitle; | |
| } |
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 array = ??? | |
| function print(x) { | |
| var s = ''; | |
| for(var i = 0, il = x.length; i < il; i++) { | |
| s += (' ' + x[i]); | |
| } | |
| console.log(s); |
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
| foo(); | |
| var foo = function() { | |
| console.log('I\'m fooing'); | |
| }; |
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
| doStuff(); | |
| var stuff = 24; | |
| function doStuff() { | |
| stuff = 42; | |
| }; | |
| console.log(stuff); |
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 a = 1, | |
| b = 'hello', | |
| c = 0, | |
| d = true, | |
| e; | |
| e = a && b && c && d; | |
| console.log(e); |