Javascript阿拉伯数字转中文 template.helper('_toChinese', function (number) { /* * 单位 */ var units = '个十百千万@#%亿^&~'; /* * 字符 */ var chars = '零一二三四五六七八九'; var a = (number + '').split(''), s = []; if (a.length > 12) { throw new Error('too big'); } else { for
github原址:https://github.com/airbnb/javascript 类型*基本类型:包括string.number.boolean.null.undefined,存储的是值本身*引用类型:包括object.array.function,存储的是值的引用 对象*使用对象字面量创建对象,而不是构造函数 //bad var item = new Object(); //good var item = {}; *不要使用保留字作为键名,它们在IE8下不工作*使用同义词替换需要使用
function CNDateString(date) { var cn = ["〇","一","二","三","四","五","六","七","八","九"]; var s = []; var YY = date.getFullYear().toString(); for (var i=0; i<YY