Adjust base library usage of for vs reduce/map (#1151)
* Adjust base library usage of `for` vs `reduce/map` * Additional * Adjust
This commit is contained in:
@@ -9,8 +9,12 @@ export class TextDecoder {
|
||||
}
|
||||
|
||||
decode (value: Uint8Array): string {
|
||||
return value.reduce((str, code): string => {
|
||||
return str + String.fromCharCode(code);
|
||||
}, '');
|
||||
let result = '';
|
||||
|
||||
for (const c of value) {
|
||||
result += String.fromCharCode(c);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user