Developers Summit 2012 で使用したスライド 後半を抜き出し少し更新したものはこちら: http://www.slideshare.net/dynamis/kanazawajsnextRead less
ある日、会社で「オブジェクトにlengthプロパティが欲しい」といわれたので色々考えてみました。。 lengthプロパティはArrayオブジェクトとかに存在するあれです。 var ary = ["a", "b", "c"]; console.log(ary.length); // output: 3 これを普通のオブジェクトにも欲しいといわれました。 理想はこんな感じらしい。 /* error */ var obj = { 'a': 1, 'b': 2, 'c': 3 }; console.log(obj.length); // output: 3 てっとりばやく関数化するとこんな感じ。 Object.prototype.length = function () { var i = 0, prop; for (prop in this) { if (this.hasOwnProperty(
$200K 1 10th birthday 4 abusive ads 1 abusive notifications 2 accessibility 3 ad blockers 1 ad blocking 2 advanced capabilities 1 android 2 anti abuse 1 anti-deception 1 background periodic sync 1 badging 1 benchmarks 1 beta 83 better ads standards 1 billing 1 birthday 4 blink 2 browser 2 browser interoperability 1 bundles 1 capabilities 6 capable web 1 cds 1 cds18 2 cds2018 1 chrome 35 chrome 81
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く