- 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');
推薦閱讀
- Kibana Essentials
- Interactive Data Visualization with Python
- ArcGIS By Example
- ASP.NET程序設計教程
- Mathematica Data Analysis
- Getting Started with Gulp
- JavaCAPS基礎、應用與案例
- 深入淺出React和Redux
- Node Cookbook(Second Edition)
- Python程序設計與算法基礎教程(第2版)(微課版)
- Web Developer's Reference Guide
- Flask開發Web搜索引擎入門與實戰
- Learning iOS Penetration Testing
- Swift iOS Programming for Kids
- 微信公眾平臺服務號開發:揭秘九大高級接口