😶🌫️
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
| setTimeout(function go() { | |
| $.get('http://javascriptquiz.com/api/q14', function(response) { | |
| //logic is not important to the demo | |
| setTimeout(go, 30000); | |
| }); | |
| }, 30000); |
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 xamlizer = (function() { | |
| 'use strict'; | |
| var __hasOwn = Object.prototype.hasOwnProperty; | |
| var propSkeleton = function() { | |
| this.enumerable = true; | |
| this.configurable = true; | |
| //this.writable = true; | |
| }; |
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
| setInterval(function() { | |
| $.get('http://javascriptquiz.com/api/q14', function(response) { | |
| //logic is not important to the demo | |
| }); | |
| }, 30000); |
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
| if(a == !a) { | |
| console.log('a is equal to its inequality!'); | |
| } else { | |
| console.log('a isn\'t equal to its inequality'); | |
| } |
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 = function() { | |
| return 1; | |
| }; | |
| var b = function() { | |
| return a(), 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
| var reader = { | |
| setup: function() { | |
| this.getData(); | |
| }, | |
| getData: function() { | |
| $.ajax({ | |
| url: 'http://api.ihackernews.com/page?format=jsonp', | |
| dataType: 'jsonp', | |
| success: function(data) { | |
| this.showData(data); |
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 whoShotFirst = function () { | |
| var firstShooter; | |
| setTimeout(function() { | |
| if(!firstShooter) | |
| firstShooter = 'Han'; | |
| }, 1); | |
| setTimeout(function() { | |
| if(!firstShooter) |
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
| ko.validatedObservable = function (initialValue, validationFunction) { | |
| var latestValue = initialValue; | |
| function observable() { | |
| if (arguments.length > 0) { | |
| // Write | |
| // Ignore writes if the value hasn't changed | |
| if (((!observable['equalityComparer']) || !observable['equalityComparer'](latestValue, arguments[0]))) { | |
| if (validationFunction.call(null, arguments[0])) { |
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,2,3], | |
| b = [4], | |
| c = [5, 6]; | |
| console.log(a + b + c); |
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 hasVideoSupport = function(o) { | |
| if(!o.canPlayType) { | |
| return false; | |
| } else { | |
| return true; | |
| } | |
| }; |