Enums in Javascript with ES6

I’m rebuilding an old Java project in Javascript, and realized that there’s no good way to do enums in JS. The best I can come up with is: const Colors = { RED: Symbol(“red”), BLUE: Symbol(“blue”), GREEN: Symbol(“green”) }; Object.freeze(Colors); The const keeps Colors from being reassigned, and freezing it prevents mutating the keys and … Read more

Is there Unicode glyph Symbol to represent “Search” [closed]

Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 6 years ago. Improve this question Unicode has a million icon-like glyphs, but they’re very hard to search. Is there a Unicode … Read more

How to change facet labels?

I have used the following ggplot command: ggplot(survey, aes(x = age)) + stat_bin(aes(n = nrow(h3), y = ..count.. / n), binwidth = 10) + scale_y_continuous(formatter = “percent”, breaks = c(0, 0.1, 0.2)) + facet_grid(hospital ~ .) + theme(panel.background = theme_blank()) to produce I’d like to change the facet labels, however, to something shorter (like Hosp … Read more

Placing Unicode character in CSS content value [duplicate]

This question already has answers here: Adding HTML entities using CSS content (9 answers) Closed 6 years ago. I have a problem. I have found the HTML code for the downwards arrow, ↓ (↓) Cool. Now I need to use it in CSS like so: nav a:hover {content:”&darr”;} That obviously won’t work since ↓ is … Read more

What is the motivation for bringing Symbols to ES6?

UPDATE: Recently a brilliant article from Mozilla came up. Read it if you’re curious. As you may know they are planning to include new Symbol primitive type in ECMAScript 6 (not to mention some other crazy stuff). I always thought that the :symbol notion in Ruby is needless; we could easily use plain strings instead, … Read more

What characters can be used for up/down triangle (arrow without stem) for display in HTML?

I’m looking for a HTML or ASCII character which is a triangle pointing up or down so that I can use it as a toggle switch. I found ↑ (↑), and ↓ (↓) – but those have a narrow stem. I’m looking just for the HTML arrow “head”. 20 20 Unicode arrows heads: ▲ – … Read more