- JavaScript:Moving to ES2015
- Ved Antani Simon Timms Narayan Prusty
- 65字
- 2021-07-09 19:07:35
A matter of style
Like the previous chapters, we will spend some time discussing the style considerations while creating arrays.
- Use the literal syntax for array creation:
// bad const items = new Array(); // good const items = [];
- Use
Array#push
instead of a direct assignment to add items to an array:const stack = []; // bad stack[stack.length] = 'pushme'; // good stack.push('pushme');
推薦閱讀
- Learning Microsoft Windows Server 2012 Dynamic Access Control
- C#高級編程(第10版) C# 6 & .NET Core 1.0 (.NET開發經典名著)
- Spring Cloud Alibaba微服務架構設計與開發實戰
- ASP.NET Core 5.0開發入門與實戰
- Learning Firefox OS Application Development
- 軟件架構:Python語言實現
- 全棧自動化測試實戰:基于TestNG、HttpClient、Selenium和Appium
- HTML5從入門到精通 (第2版)
- 移動界面(Web/App)Photoshop UI設計十全大補
- LabVIEW虛擬儀器程序設計從入門到精通(第二版)
- Modern C++ Programming Cookbook
- C++ Fundamentals
- Solutions Architect's Handbook
- PHP 8從入門到精通(視頻教學版)
- Python預測分析實戰