Home > OS >  convert css unicode to js
convert css unicode to js

Time:11-21

I have a couple of emoji unicodes that works well in css:

    content: "\f410"
    content: "\f2d1"

I tries to output it with javascript, but I failed, I will be so grateful for any suggestion you may offer.

console.log('\f410');
console.log('\Uf410');

CodePudding user response:

It should be console.log('\uf410');, lower case u.

ps: and maybe you also like something like: console.log(String.fromCharCode(parseInt('f410',16))).

  • Related