把原始碼轉成 HTML

Posted by: 邱小新 at 下午5:54:00 in

計算字串所佔的 bytes

Posted by: 邱小新 at 下午3:54:00
function byteLength(str) { // returns the byte length of an utf8 string var s = str.length; for (var i=str.length-1; i>=0; i--) { var code = str.charCodeAt(i); if (code > 0x7f && code <= 0x7ff) s++; else if (code > 0x7ff && code <= 0xffff) s+=2; if (code >= 0xDC00 && code <= 0xDFFF) i--; //trail surrogate } return s; } 來源: String length in bytes in JavaScript

javascript json

Posted by: 邱小新 at 下午5:41:00 in

JSON 是就是 JavaScript 物件語法的資料格式,所以只要懂得 javascript 的物件就知道什麼是 JSON。

object

list

redmi note4 刷機

Posted by: 邱小新 at 凌晨1:14:00 in

ROM

Reference