String.fromCharCodes()

๐Ÿ”ฐ JS โŸฉ Types โŸฉ String โŸฉ methods

// โญ๏ธ String.fromCharCodes(65, 70) -> 'ABCDEF'
String.fromCharCodes = function(from, to){
    let array = [];
    for(let i = from; i <= to; i++) array.push(i);
    return array
        .map(code => String.fromCharCode(code))
        .join('');
};

// โญ๏ธ StringfromCharCodes(65, 70) -> 'ABCDEF'
export function StringfromCharCodes(from, to){
    let array = [];
    for(let i = from; i <= to; i++) array.push(i);
    return array
        .map(code => String.fromCharCode(code))
        .join('');
};

Last updated