How and why does 'z'['toUpperCase']() in JavaScript work?

JavascriptObject Oriented ProgrammingFront End Technology

The toUpperCase() method in JavaScript is used to convert a string in uppercase. Here, a is a primitive value. You can use it as the following −


Or use the following via bracket notation −


The code snippet is the same as the following to convert to upper case −

Published on 27-Feb-2018 15:23:46