![thunkli](https://blog.arayofsunshine.dev/wp-content/themes/arayofsunshine/images/idea-pic.png)
![thunkli](https://blog.arayofsunshine.dev/wp-content/themes/arayofsunshine/images/idea-pic.png)
JavaScript modules
现在,所有主流浏览器都支持JavaScript modules! 本文介绍了如何使用JS modules,如何负责任地部署它们以及Chrome团队如何努力使modules在将来变得更好。 什么是JS模块? JS模块(也称为“ES模块”或“ECMAScript模块”)是一项主要的新功能,或者是新功能的集合。 您过去可能使用过userland JavaScript模块系统。 也许您在Node.js中使用过CommonJS,或者在AMD中使用过,或者在其他方面使用过。 所有这些模块系统都有一个共同点: … 继续阅读
![thunkli](https://blog.arayofsunshine.dev/wp-content/themes/arayofsunshine/images/idea-pic.png)
Number、parseIn和parseFloat
有3个函数可以把非数值转化成数值:Number()、parseInt()和parseFloat()。第一个函数,即转型函数Number()可以用于任何数据类型,而另两个函数则专门用于把字符串转换成数值。 继续阅读
![thunkli](https://blog.arayofsunshine.dev/wp-content/themes/arayofsunshine/images/idea-pic.png)
JavaScript拖放
最早在网页中引入JavaScript拖放功能是IE4。当时,网页中只有两种对象可以拖放:图像和某些文本。HTML5以IE的实例为基础指定了拖放规范。 继续阅读
![thunkli](https://blog.arayofsunshine.dev/wp-content/themes/arayofsunshine/images/idea-pic.png)
push、pop、shift、unshift
ECMAScript还为数组提供了一个unshift()方法。unshift()shift()的用途相反:它能在数组的前端添加任意各项并返回新数组的长度。 继续阅读
![thunkli](https://blog.arayofsunshine.dev/wp-content/themes/arayofsunshine/images/idea-pic.png)
![thunkli](https://blog.arayofsunshine.dev/wp-content/themes/arayofsunshine/images/idea-pic.png)
![thunkli](https://blog.arayofsunshine.dev/wp-content/themes/arayofsunshine/images/idea-pic.png)
![thunkli](https://blog.arayofsunshine.dev/wp-content/themes/arayofsunshine/images/idea-pic.png)
concat、slice、substr和substring
下面介绍与操作字符有关的几个方法。第一个就是concat(),用于将一或多个字符串拼接起来,返回拼接得到的新字符串。 继续阅读
![thunkli](https://blog.arayofsunshine.dev/wp-content/themes/arayofsunshine/images/idea-pic.png)