I am trying to convert the following to work, but I think it is an Es5/ES6 issue. Help Appreciated.
this.rows = Array.from(Array(Math.ceil(this.subCategoryModels.length / 3)).keys());
I currently get typscript errors:
[ts]
Property 'from' does not exist on type 'ArrayConstructor'.
any
and
[ts]
Property 'keys' does not exist on type 'any[]'.
any
Array.from()and.keys()are ES6 methods, so obviously they won't work in ES5.this.rows = Array.from(new Array(Math.ceil(this.subCategoryModels.length / 3)).keys());for (var index = 0; index < Math.ceil(this.subCategoryModels.length / 3); index++) { this.rows.push(index); }