String Method in JavaScript

Level 258 keystrokes

This converts the string to lowercase and outputs 'hello world'.

JavaScript code

// Declare a string with mixed case
1let text = "Hello World";
// toLowerCase() converts all characters to lowercase
// It returns a new string, doesn't modify the original
// "Hello World" becomes "hello world"
2console.log(text.toLowerCase());

Output

hello world
Practice typing this code

Practice typing this code. Results are not recorded in the rankings.

Symbols in this code

The symbols you type in this JavaScript code and how often they appear.

  • ;× 2
  • .× 2
  • "× 2
  • (× 2
  • )× 2
  • =× 1

More JavaScript examples at level 2

← JavaScript typing practice