• If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!


Week 2

Page history last edited by Shana L. McDanold 12 years, 2 months ago

Week 2 Session


Summary: Javascript Functions, Hello New York app





Exercise 1.4 (Fix Me) was broken, but now seems to have been fixed at the Codeacademy end

Comments (2)

Christine DeZelar-Tiedman said

at 3:35 pm on Jan 17, 2012

I still can't get it to work, so I must be doing something else wrong. Here is the code I'm using:

var fullName = "";
var name;
var firstLetter;
fixName function definition should go here.
fixName = function() {
firstLetter = name.substring(0, 1);
name = firstLetter.toUpperCase() + name.substring(1);
fullName = fullName + " " + name;
name = prompt("Enter your first name (all in lower case):");


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


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

And here is the error message I'm getting:
[Exception... "Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIDOMWindow.prompt]" nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)" location: "JS frame :: http://www.codecademy.com/assets/jsrepl/sandbox.js :: <TOP_LEVEL> :: line 52" data: no]

Sigh. I was hoping I wouldn't be so completely out of my depth so soon.

byoose said

at 5:19 pm on Jan 17, 2012

Christine, I see that you call fixname instead of fixName, the exact name for your function. You will want to change those two function calls and run the code again.

You don't have permission to comment on this page.