4. Fix me


#1

https://www.codecademy.com/en/courses/functions-in-javascript-2-0/0/4#


I fixed the function code, when I run it I get the wanted result in the console log but codeCademy says its false.


var fullName = "";
var name;
var firstLetter;
/*
   fixName function definition should go here.
*/
function fixName(){
    firstLetter = name.substring(0, 1);
name = firstLetter.toUpperCase() + name.substring(1);
fullName = fullName + " " + name;
}

name = prompt("Enter your first name (all in lower case):");
fixName();




console.log("And your full name is:" + fullName);


#2

It appears there is some code missing. What about the last name?


#3

thank you for pointing out my mistake :smiley:

it worked !


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.