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
Module dynamicList { | |
import xhr from '/dataSources.js'; // dataSources is another module | |
import template at '/tpls/list.js'; | |
var classNames = ['dynamic', 'vertical']; | |
var refreshInterval = 300000; //ms | |
var run = function (rootElt, params) { | |
return setInterval(function () { | |
xhr.get('/list', params, function (data) { | |
template.compile(data, rootElt, {classes: classNames}); |
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 i = { | |
a : function () { }, | |
BASE_VALUE: 42 | |
} |
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 AdamsModule = (function (foo, bar) { | |
var theAnswer = 42; | |
var questionFromAnswer = function () { /** ? **/ }; | |
return { | |
getTheAnswer : function () { return theAnswer; }, | |
computeQuestion : function () { | |
questionFromAnswer(this.getTheAnswer()); | |
} | |
} | |
})(foo, bar) |
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
Program ::= ProgramElement* | |
ProgramElement ::= Statement | |
| VariableDeclaration | |
| FunctionDeclaration | |
| ImportDeclaration | |
| ExportDeclaration | |
| ModuleDeclaration | |
ModuleSpecifier ::= StringLiteral | Path | |
ModuleDeclaration ::= "module" Id "at" String ";" |
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
/** | |
* Comparing a String object and a simple string | |
**/ | |
var myStringSimple = 'abcd'; | |
console.log(myStringSimple instanceof String); // false | |
console.log(typeof(myStringSimple)); // 'string' | |
var myStringObject = new String('abcd'); | |
console.log(myStringSimple instanceof String); // true |
NewerOlder