Insert Unicode character into JavaScript

I’m guessing that you actually want Omega to be a string containing an uppercase omega? In that case, you can write:

var Omega="\u03A9";

(Because Ω is the Unicode character with codepoint U+03A9; that is, 03A9 is 937, except written as four hexadecimal digits.)

Edited to add (in 2022): There now exists an alternative form that better supports codepoints above U+FFFF:

let Omega="\u{03A9}";
let desertIslandEmoji = '\u{1F3DD}';

Judging from https://caniuse.com/mdn-javascript_builtins_string_unicode_code_point_escapes, most or all browsers added support for it in 2015, so it should be reasonably safe to use.

Leave a Comment