Get Programming with JavaScript - Listing 7.07

Listing 7.07 - Converting a string to upper case

var planet = "Jupiter"; var bigPlanet = planet.toUpperCase(); console.log(planet + " becomes " + bigPlanet);

Further Adventures

Listing 7.07 - Converting a string to upper case - Task 1

var planet = "Jupiter"; var getBig = function (text) { return text.toUpperCase(); }; console.log(planet + " becomes " + getBig(planet));

Listing 7.07 - Converting a string to upper case - Task 2

var planet = "Jupiter"; var getSmall = function (text) { return text.toLowerCase(); }; console.log(planet + " becomes " + getSmall(planet));