Get help on our basic JavaScript and Algorithms Challenges. If you are posting code that is large use Gist - https://gist.github.com/ paste the link here.
thecodingaviator on master
remove A (#31157) (compare)
function titleCase(str) {
return str.split(" ")[0].toUpperCase().join(" ");
}
titleCase("I'm a little tea pot");
function titleCase(str) {
str = str.split(' ').map(function(value){
return value.split('').map(function(val,index){
if (index === 0)
return val.toUpperCase();
else
return val.toLowerCase();
}).join('');
}).join(' ');
return str;
}
titleCase("I'm a little tea pot");
function myLocalScope() {
'use strict';
console.log(myVar);
}
myLocalScope();
// Run and check the console
// myVar is not defined outside of myLocalScope
console.log(myVar);
// Now remove the console log line to pass the test
It says to delcrare local variable myVar inside mylocalscope
than follow the instructions please help