Home > Web Front-end > JS Tutorial > body text

Summary of common functions in JS

php中世界最好的语言
Release: 2018-03-09 10:32:21
Original
2058 people have browsed it

这次给大家带来JS中的常用函数汇总,使用JS中的常用函数的注意事项有哪些,下面就是实战案例,一起来看一下。

//数字每隔三位加',',如1000变为'1,000'function num
For
mat( params ) {    var value = ( params + '').split('.');
    value = value[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g, '$1,');    
return
 value;
}
Copy after login

相信看了本文案例你已经掌握了方法,更多精彩请关注php中文网其它相关文章!

相关阅读:

用React完成一个图片轮播组件

和段落

写一个三毛语录

在HTML中如何用标签编写个人收藏夹

HTML的内联样式改进《三毛经典语录》

The above is the detailed content of Summary of common functions in JS. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!