MacTavish Lee

Results 7 comments of MacTavish Lee

> > 如果一行写不出来,我选择不写 > > ```js > > // 德国以 . 分割金钱, 转到德国当地格式化方案即可 > > 10000000000..toLocaleString('de-DE') > > > > // 寻找字符空隙加 . > > '10000000000'.replace(/\B(?=(\d{3})+(?!\d))/g, '.') > > >...

AMD,CMD用的不多,主要讲一下CommonJS和ESModule ## 模块的特性 - 为创建一个内部作用域而调用了一个包装函数。 - 包装函数的返回值至少包含一个对内部函数的引用,这样才会创建涵盖整个包装函数内部作用域的闭包。 ### CommonJS 特点: `require`、`module.exports`、`exports` CommonJS 一般用在服务端或者Node用来同步加载模块,它对于模块的依赖发生在代码运行阶段,不适合在浏览器端做异步加载。 `exports`实际上是一个对`module.exports`的引用: ```javascript exports.add = function add () {/* 方法 */} // 等同于 module.exports.add = function add ()...

### 递归写法 ```javascript function flatten(arr) { let result = [] for(let i = 0; i < arr.length; i++) { if (Array.isArray(arr[i])) { result = result.concat(flatten(arr[i])) } else { result.push(arr[i]) }...

Second one is original,but first one has a good compatibility for the new version`tfjs`.

More info in this issue [782](https://github.com/justadudewhohacks/face-api.js/issues/782)

Did you solve this problem yet? I'm working with a mask detect system now, get in trouble with this problem.

@amiralam0 Try this one. https://github.com/vladmandic/face-api