任天堂「今後C++は捨てJavaScriptで開発していく」 (887レス)
任天堂「今後C++は捨てJavaScriptで開発していく」 http://mevius.5ch.net/test/read.cgi/tech/1363752460/
上
下
前次
1-
新
通常表示
512バイト分割
レス栞
抽出解除
レス栞
リロード規制
です。10分ほどで解除するので、
他のブラウザ
へ避難してください。
196: デフォルトの名無しさん [sage] 2013/03/22(金) 08:40:49.75 >>193 >var x = (function() {var maxLength;})(); 意味がわからない。このコードじゃxに入るのはundefined あんたがやりたいのはこんな感じのことじゃないのか? var x={maxLength:0, setMaxLength:function(v){this.maxLength=v}, getMaxLength:function(){return this.maxLength}}; http://mevius.5ch.net/test/read.cgi/tech/1363752460/196
198: デフォルトの名無しさん [sage] 2013/03/22(金) 08:42:48.67 >>196 悪いけど、昼休みまで待ってくれ。 http://mevius.5ch.net/test/read.cgi/tech/1363752460/198
203: デフォルトの名無しさん [sage] 2013/03/22(金) 11:37:19.10 >>200 ありがと。 >>196 それだと、maxLengthを隠蔽できてない。 newを使う場合はこう。 var Foo = function() {var maxLength;}; Foo.prototype.setMaxLength = function(val) {maxLength = val;} Foo.prototype.getMaxLength = function() {return maxLength;}; var x = new Foo(); console.log(x.maxLength); // => undefined x.setMaxLength(100); console.log(x.getMaxLength()); // => 100 console.log(x.maxLength); // => undefined x.maxLength = 200; // => can't change Foo's property console.log(x.getMaxLength()); // => 100 try { console.log(x.getMaxlength()); } catch (e) { console.log(e.message); } http://mevius.5ch.net/test/read.cgi/tech/1363752460/203
メモ帳
(0/65535文字)
上
下
前次
1-
新
書
関
写
板
覧
索
設
栞
歴
スレ情報
赤レス抽出
画像レス抽出
歴の未読スレ
Google検索
Wikipedia
ぬこの手
ぬこTOP
0.035s