任天堂「今後C++は捨てJavaScriptで開発していく」 (887レス)
1-

203
(4): 2013/03/22(金)11:37 AAS
>>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);
}
1-
あと 684 レスあります
スレ情報 赤レス抽出 画像レス抽出 歴の未読スレ

ぬこの手 ぬこTOP 0.013s