摘要: function safeGet (data, path){ if (!path) return undefined var paths = path.split('.') var res = data while (paths.length) { res = res[paths.shift()] 阅读全文
posted @ 2017-10-11 17:02 风吹麦浪打 阅读(384) 评论(0) 推荐(0) 编辑
摘要: 例如:extractStr('My name is:Jerry. My age is:12.') // => ['Jerry', '12'] 阅读全文
posted @ 2017-10-11 16:46 风吹麦浪打 阅读(209) 评论(0) 推荐(0) 编辑
摘要: const toChineseNum = (num) => { const unit = ['', '十', '百', '千'] const counts = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九'] const pre = Math.floor(num / 10000) const ne... 阅读全文
posted @ 2017-10-11 16:44 风吹麦浪打 阅读(1337) 评论(0) 推荐(0) 编辑