admin管理员组文章数量:1353643
This is my object var loginParameters = ["Tander", "ali", "1", "WINDOWS", "2.0", "TOSHIBA-PC"]
And I want to convert this object to byte array that will look like byte[] objName
. But I couldn't find anything about this.
How can I succeed this?
This is my object var loginParameters = ["Tander", "ali", "1", "WINDOWS", "2.0", "TOSHIBA-PC"]
And I want to convert this object to byte array that will look like byte[] objName
. But I couldn't find anything about this.
How can I succeed this?
Share Improve this question edited Nov 8, 2013 at 13:07 user1838179 asked May 15, 2013 at 7:39 Mehmet InceMehmet Ince 4,18914 gold badges47 silver badges65 bronze badges 2- Where is the object man....?? – Prasath K Commented May 15, 2013 at 7:43
- Sorry about notation. I am not skilled with js. I mean 'loginParamaters' object. – Mehmet Ince Commented May 15, 2013 at 7:46
1 Answer
Reset to default 6var mainbytesArray = [];
for(var i = 0; i < loginParameters.length; i++){
var bytes = [];
for (var j = 0; j < loginParameters[i].length; ++j)
bytes.push(loginParameters[i].charCodeAt(j));
mainbytesArray.push(bytes);
}
本文标签: How to cast an object to byte array in javascriptStack Overflow
版权声明:本文标题:How to cast an object to byte array in javascript - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1743913496a2560820.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论