class Animal name: "animal" move: (meters) -> alert (@name + " moved " + meters + "m." ) class Snake extends Animal constructor: (name) -> @name: name move: -> alert ( "Slithering..." ) super ( 5 ) class Horse extends Animal constructor: (name) -> @name: name move: -> alert ( "Galloping..." ) super ( 45 ) sam: new Snake ( "Sammy the Python" ) tom: new Horse ( "Tommy the Palomino" ) sam.move() tom.move()class Animal name: "animal" move: (meters) -> alert (@name + " moved " + meters + "m." ) class Snake extends Animal constructor: (name) -> @name: name move: -> alert ( "Slithering..." ) super ( 5 ) class Horse extends Animal constructor: (name) -> @name: name move: -> alert ( "Galloping..." ) super ( 45 ) sam: new Snake ( "Sammy the Python" ) tom: new Horse ( "Tommy the Palomino" ) sam.move() tom.move()class Animal name: "animal" move: (meters) -> alert (@name + " moved " + meters + "m." ) class Snake extends Animal constructor: (name) -> @name: name move: -> alert ( "Slithering..." ) super ( 5 ) class Horse extends Animal constructor: (name) -> @name: name move: -> alert ( "Galloping..." ) super ( 45 ) sam: new Snake ( "Sammy the Python" ) tom: new Horse ( "Tommy the Palomino" ) sam.move() tom.move()class Animal name: "animal" move: (meters) -> alert (@name + " moved " + meters + "m." ) class Snake extends Animal constructor: (name) -> @name: name move: -> alert ( "Slithering..." ) super ( 5 ) class Horse extends Animal constructor: (name) -> @name: name move: -> alert ( "Galloping..." ) super ( 45 ) sam: new Snake ( "Sammy the Python" ) tom: new Horse ( "Tommy the Palomino" ) sam.move() tom.move()class Animal name: "animal" move: (meters) -> alert (@name + " moved " + meters + "m." ) class Snake extends Animal constructor: (name) -> @name: name move: -> alert ( "Slithering..." ) super ( 5 ) class Horse extends Animal constructor: (name) -> @name: name move: -> alert ( "Galloping..." ) super ( 45 ) sam: new Snake ( "Sammy the Python" ) tom: new Horse ( "Tommy the Palomino" ) sam.move() tom.move()class Animal name: "animal" move: (meters) -> alert (@name + " moved " + meters + "m." ) class Snake extends Animal constructor: (name) -> @name: name move: -> alert ( "Slithering..." ) super ( 5 ) class Horse extends Animal constructor: (name) -> @name: name move: -> alert ( "Galloping..." ) super ( 45 ) sam: new Snake ( "Sammy the Python" ) tom: new Horse ( "Tommy the Palomino" ) sam.move() tom.move()class Animal name: "animal" move: (meters) -> alert (@name + " moved " + meters + "m." ) class Snake extends Animal constructor: (name) -> @name: name move: -> alert ( "Slithering..." ) super ( 5 ) class Horse extends Animal constructor: (name) -> @name: name move: -> alert ( "Galloping..." ) super ( 45 ) sam: new Snake ( "Sammy the Python" ) tom: new Horse ( "Tommy the Palomino" ) sam.move() tom.move()class Animal name: "animal" move: (meters) -> alert (@name + " moved " + meters + "m." ) class Snake extends Animal constructor: (name) -> @name: name move: -> alert ( "Slithering..." ) super ( 5 ) class Horse extends Animal constructor: (name) -> @name: name move: -> alert ( "Galloping..." ) super ( 45 ) sam: new Snake ( "Sammy the Python" ) tom: new Horse ( "Tommy the Palomino" ) sam.move() tom.move()class Animal name: "animal" move: (meters) -> alert (@name + " moved " + meters + "m." ) class Snake extends Animal constructor: (name) -> @name: name move: -> alert ( "Slithering..." ) super ( 5 ) class Horse extends Animal constructor: (name) -> @name: name move: -> alert ( "Galloping..." ) super ( 45 ) sam: new Snake ( "Sammy the Python" ) tom: new Horse ( "Tommy the Palomino" ) sam.move() tom.move()class Animal name: "animal" move: (meters) -> alert (@name + " moved " + meters + "m." ) class Snake extends Animal constructor: (name) -> @name: name move: -> alert ( "Slithering..." ) super ( 5 ) class Horse extends Animal constructor: (name) -> @name: name move: -> alert ( "Galloping..." ) super ( 45 ) sam: new Snake ( "Sammy the Python" ) tom: new Horse ( "Tommy the Palomino" ) sam.move() tom.move()class Animal name: "animal" move: (meters) -> alert (@name + " moved " + meters + "m." ) class Snake extends Animal constructor: (name) -> @name: name move: -> alert ( "Slithering..." ) super ( 5 ) class Horse extends Animal constructor: (name) -> @name: name move: -> alert ( "Galloping..." ) super ( 45 ) sam: new Snake ( "Sammy the Python" ) tom: new Horse ( "Tommy the Palomino" ) sam.move() tom.move()class Animal name: "animal" move: (meters) -> alert (@name + " moved " + meters + "m." ) class Snake extends Animal constructor: (name) -> @name: name move: -> alert ( "Slithering..." ) super ( 5 ) class Horse extends Animal constructor: (name) -> @name: name move: -> alert ( "Galloping..." ) super ( 45 ) sam: new Snake ( "Sammy the Python" ) tom: new Horse ( "Tommy the Palomino" ) sam.move() tom.move()class Animal name: "animal" move: (meters) -> alert (@name + " moved " + meters + "m." ) class Snake extends Animal constructor: (name) -> @name: name move: -> alert ( "Slithering..." ) super ( 5 ) class Horse extends Animal constructor: (name) -> @name: name move: -> alert ( "Galloping..." ) super ( 45 ) sam: new Snake ( "Sammy the Python" ) tom: new Horse ( "Tommy the Palomino" ) sam.move() tom.move()class Animal name: "animal" move: (meters) -> alert (@name + " moved " + meters + "m." ) class Snake extends Animal constructor: (name) -> @name: name move: -> alert ( "Slithering..." ) super ( 5 ) class Horse extends Animal constructor: (name) -> @name: name move: -> alert ( "Galloping..." ) super ( 45 ) sam: new Snake ( "Sammy the Python" ) tom: new Horse ( "Tommy the Palomino" ) sam.move() tom.move()class Animal name: "animal" move: (meters) -> alert (@name + " moved " + meters + "m." ) class Snake extends Animal constructor: (name) -> @name: name move: -> alert ( "Slithering..." ) super ( 5 ) class Horse extends Animal constructor: (name) -> @name: name move: -> alert ( "Galloping..." ) super ( 45 ) sam: new Snake ( "Sammy the Python" ) tom: new Horse ( "Tommy the Palomino" ) sam.move() tom.move()class Animal name: "animal" move: (meters) -> alert (@name + " moved " + meters + "m." ) class Snake extends Animal constructor: (name) -> @name: name move: -> alert ( "Slithering..." ) super ( 5 ) class Horse extends Animal constructor: (name) -> @name: name move: -> alert ( "Galloping..." ) super ( 45 ) sam: new Snake ( "Sammy the Python" ) tom: new Horse ( "Tommy the Palomino" ) sam.move() tom.move()class Animal name: "animal" move: (meters) -> alert (@name + " moved " + meters + "m." ) class Snake extends Animal constructor: (name) -> @name: name move: -> alert ( "Slithering..." ) super ( 5 ) class Horse extends Animal constructor: (name) -> @name: name move: -> alert ( "Galloping..." ) super ( 45 ) sam: new Snake ( "Sammy the Python" ) tom: new Horse ( "Tommy the Palomino" ) sam.move() tom.move()class Animal name: "animal" move: (meters) -> alert (@name + " moved " + meters + "m." ) class Snake extends Animal constructor: (name) -> @name: name move: -> alert ( "Slithering..." ) super ( 5 ) class Horse extends Animal constructor: (name) -> @name: name move: -> alert ( "Galloping..." ) super ( 45 ) sam: new Snake ( "Sammy the Python" ) tom: new Horse ( "Tommy the Palomino" ) sam.move() tom.move()class Animal name: "animal" move: (meters) -> alert (@name + " moved " + meters + "m." ) class Snake extends Animal constructor: (name) -> @name: name move: -> alert ( "Slithering..." ) super ( 5 ) class Horse extends Animal constructor: (name) -> @name: name move: -> alert ( "Galloping..." ) super ( 45 ) sam: new Snake ( "Sammy the Python" ) tom: new Horse ( "Tommy the Palomino" ) sam.move() tom.move()class Animal name: "animal" move: (meters) -> alert (@name + " moved " + meters + "m." ) class Snake extends Animal constructor: (name) -> @name: name move: -> alert ( "Slithering..." ) super ( 5 ) class Horse extends Animal constructor: (name) -> @name: name move: -> alert ( "Galloping..." ) super ( 45 ) sam: new Snake ( "Sammy the Python" ) tom: new Horse ( "Tommy the Palomino" ) sam.move() tom.move()
class Animal name: "animal" move: (meters) -> alert (@name + " moved " + meters + "m." ) class Snake extends Animal constructor: (name) -> @name: name move: -> alert ( "Slithering..." ) super ( 5 ) class Horse extends Animal constructor: (name) -> @name: name move: -> alert ( "Galloping..." ) super ( 45 ) sam: new Snake ( "Sammy the Python" ) tom: new Horse ( "Tommy the Palomino" ) sam.move() tom.move()
( 関数 (){var Animal、Horse、Snake、Sam、Tom;var __extends = function (child、parent){var ctor = function (){};ctor.prototype = parent.prototype;子.__ superClass__ = parent.prototype;child.prototype = new ctor();child.prototype.constructor = child;};動物= 関数 (){};Animal.prototype.move = function (meters){警告を返す ( この .name + "moved" + meter + "m。" );};スネーク= 関数 (名前){this .name = name;これを返す ;};__extends(ヘビ、動物);Snake.prototype.move = function (){アラート( 「スリザリング...」 );return Snake .__ superClass __。move.call( this 、 5 );};Horse = function (name){this .name = name;これを返す ;};__extends(馬、動物);Horse.prototype.move = function (){alert( "ギャロッピング..." );return Horse .__ superClass __。move.call( this 、 45 );};sam = new Snake( "Sammy the Python" );tom = new Horse( "パロミノトミー" );sam.move();tom.move();})();
クラス データmanyData:nullコンストラクター:->遅延:新しい遅延()@initData(遅延)SomeClass.fillData(遅延)initData:(遅延)->deferred.addCallback:(データ)=>@manyData:データdeferred.addCallback:(エラー)->アラート (error.name + ":" + error.message)新しいデータ ()
var Data;データ= 関数 (){var deferred;deferred = new Deferred();this .initData(遅延);SomeClass.fillData(遅延);これを返す ;};Data.prototype.manyData = null ;Data.prototype.initData = function (deferred){deferred.addCallback =( function (__this){var __func = function (data){this .manyData = data;この .manyDataを返します。};return ( function (){return __func.apply(__ this、arguments);});})( this );deferred.addCallback = function (error){警告を返す (error.name + ":" + error.message);};return deferred.addCallback;};新しいデータ();
var
function
` `
hi: `関数(){return [document.title、 "Hello JavaScript" ] .join( ":" );} ``var getSomeValue = function(){...}`
var hi;hi = 関数 (){return [document.title、 "Hello JavaScript" ] .join( ":" );};var getSomeValue = function (){...};
コレステロール: 127健康: 200 >コレステロール> 60
コレステロールの健康、健康;コレステロール= 127 ;健康=( 200 >コレステロール)&&(コレステロール> 60 );
theBait: 1000theSwitch: 0[theBait、theBait]:[theSwitch、theBait]
var _a、theBait、theSwitch;theBait = 1000 ;theSwitch = 0 ;_a = [theSwitch、theBait];theBait = _a [ 0 ];theSwitch = _a [ 1 ];
番号:[ 0 .. 9 ]threeToSix:数字[ 3 .. 6 ]コピー:数字[ 0 ... numbers.length]
var copy、numbers、threeToSix;数字=( 関数 (){a = []; for ( var i = 0 ;( 0 <= 9 ?i <= 9 :i> = 9 );( 0 <= 9 ?i + = 1 :i-= 1 ))a.push(i);を返します;})。call( this );threeToSix = numbers.slice(3、6 + 1 );copy = numbers.slice( 0 、numbers.length);
yearsOld:{max: 10 、ida: 9 、tim: 11 }年齢:子供の場合、年齢子+ "is" +年齢
var _a、_b、年齢、年齢、子供、yearsOld;var __hasProp = Object.prototype.hasOwnProperty;yearsOld = {最大: 10 、ida: 9 、tim: 11};年齢=( 関数 (){_a = []; _b = yearsOld;for (_bの子){ if (__hasProp.call(_b、child)){年齢= _b [子];_a.push(子+ "is" +年齢);}}return _a;})();
年:[ 2000 .. 2010 ]何年も「年」 +年
var _a、_b、_c、年、年;年=( 関数 (){a = []; for ( var i = 2000 ;( 2000 <= 2010 ?i <= 2010 :i> = 2010 );( 2000 <= 2010 ?i + = 1 :i-= 1 ))a.push(i);を返します;})。call( this );_b =年;for (_a = 0 、_c = _b.length; _a <_c; _a ++){年= _b [_a];「年は」 +年。}
Source: https://habr.com/ru/post/J97993/More articles:eLearnExpo 2010:面白かった!電子産業はコンゴでの戦争に責任を負っているWikiGuide-ウクライナの観光名所のAndroid百科事典コンパックアルマダ1530テクノパークでチェックイン(写真レポート)I2P-独自のWebサイトの作成7月1日から-最大1000ユーロの物品の免税輸入(5〜10,000ルーブル)ミッドレンジのスーパーコンピューターの問題Alan.Platformチュートリアル(パート2)規模と時間に関するフラクタル時計または思考All Articles