how to work with javascript typed arrays without using for
Posted
by
ramesh babu
on Stack Overflow
See other posts from Stack Overflow
or by ramesh babu
Published on 2012-09-27T09:13:37Z
Indexed on
2012/09/27
9:37 UTC
Read the original article
Hit count: 254
var sendBuffer = new ArrayBuffer(4096);
var dv = new DataView(sendBuffer);
dv.setInt32(0, 1234);
var service = svcName;
for (var i = 0; i < service.length; i++) {
dv.setUint8(i + 4, service.charCodeAt(i));
}
ws.send(sendBuffer);
how to workout this wihout using for loop. for loop decreasing performance while works with huge amount of data.
© Stack Overflow or respective owner