Javascriptオブジェクトを初期化する2つの方法に基づいて、どちらが優れているか、どちらが高速ですか?
// first
options = {
prop1: 1,
prop2: 2
}
//second
Secoptions = {};
Secoptions.prop1 = 1;
Secoptions.prop2 = 2;
(function($) {
$(document).ready(function() {
//based on the two ways of initializing a javascript object
//which one is the better one and faster
// first
options = {
prop1: 1,
prop2: 2
}
//second
Secoptions = {};
Secoptions.prop1 = 1;
Secoptions.prop2 = 2;
});
})(jQuery);