How to print a _variable in CAPITALS

+1 vote
asked Aug 10 by Charlie (2,210 points)
<<set _colour to "red">>

Is there a simple way to make the browser display: RED

2 Answers

+1 vote
answered Aug 10 by Akjosch (3,950 points)
selected Aug 10 by Charlie
Best answer

Using standard JavaScript methods:

<<- _colour.toUpperCase()>>

Or if you'd rather prefer lodash, which deals with undefined or not-real-string variables nicely:

<<- _.toUpper(_colour)>>


+1 vote
answered Aug 10 by Chapel (27,390 points)

You can use the toUpperCase() method: 

<<print _colour.toUpperCase()>>

Edit: Whoops, didn't see that @Akjosch beat me to it.