Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

make country flags in js

function getFlagEmoji(countryCode) {
    const codePoints = countryCode
        .toUpperCase()
        .split('')
        .map(char =>  127397 + char.charCodeAt());
    return String.fromCodePoint(...codePoints);
}
console.log(getFlagEmoji("EU"));
 
PREVIOUS NEXT
Tagged: #country #flags #js
ADD COMMENT
Topic
Name
6+2 =