如何在Javascript中使ArrayBuffer不可变?

时间:2018-01-20 19:42:10

标签: javascript

如何在Javascript中使import csv with open("hisEasyR.txt", "a") as hisEasyRFile: writer = csv.writer(hisEasyRFile, delimiter='|') writer.writerows(results) 不可变的内容? |方法似乎不起作用。有没有办法实现呢?它会成为可能吗?

1 个答案:

答案 0 :(得分:1)

您可以将ArrayBuffer转换为使用data URI定义的const不可变字符串

const reader = new FileReader;

reader.onload = () => { const ab = reader.result // `ab` cannot be changed }

reader.readAsDataURL(new ArrayBuffer(123));

请参阅Is it possible to delete a variable declared using const?