The code below is in foreach, but we all know that foreach is the slowest iteration in JavaScript, how can I make it fast?
(下面的代码在foreach中,但是我们都知道foreach是JavaScript中最慢的迭代,如何使它更快?)
any recode you would suggest?(您会建议重新编码吗?)
Thank you in advance.(先感谢您。)
Please see my code below, its so super slow:(请在下面查看我的代码,它是如此之慢:)
//for all data
gData.forEach
(
function( shape )
{
// add to parent
this.addShape
(
shape.id, /* id */
shape.type, /* type */
shape.text, /* type */
shape.left, /* left */
shape.top, /* top */
shape.width, /* width */
shape.height, /* height */
shape.link
);
}
);
ask by Joe translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…