Skip to content

Commit d2146cb

Browse files
authored
Use .fill instead of loop
1 parent 7d0b447 commit d2146cb

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

ts_src/index.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@
77
function base (ALPHABET: string): base.BaseConverter {
88
if (ALPHABET.length >= 255) throw new TypeError('Alphabet too long')
99

10-
const BASE_MAP = new Uint8Array(256)
11-
for (let j = 0; j < BASE_MAP.length; j++) {
12-
BASE_MAP[j] = 255
13-
}
10+
const BASE_MAP = new Uint8Array(256).fill(255);
1411

1512
for (let i = 0; i < ALPHABET.length; i++) {
1613
const x = ALPHABET.charAt(i)

0 commit comments

Comments
 (0)