The browser storage localStorage is not available. Either your browser does not support it or you have disabled it or the maximum memory size is exceeded. Without localStorage your solutions will not be stored.

String: trim()

The trim method removes whitespaces from both ends of a string.
var input = ' Rosa Parks ';
var name = input.trim();
name contains the string 'Rosa Parks'. Notice that input still contains the string ' Rosa Parks '.

Exercise

Write a function firstChar, which returns the first character that is not a space when a string is passed. firstChar(' Rosa Parks ') should return 'R'.
var firstChar = function(text) {
// Trim first.
// Then use the
// charAt method.
};
var firstChar = function(text) {
  var trimmedText = text.trim();
  return trimmedText.charAt(0);
};