Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

olu adesina
olu adesina
23,007 Points

JavaScript HELP keep getting a Uncaught SyntaxError: Unexpected identifier

function profile(){
    this.name=prompt('whats your name?');
    this.age=prompt('what is age?')
    this.gender=prompt('whats your gender?');


}

var olu = new profile();


// user interface //////

var UserInterface = {
    displayProfile: function(){
        alert('is this working')

    }


UserInterface.displayProfile(); //i keep getting an error here Help

Edited for readability by Dane E. Parchment Jr. (Moderator)

2 Answers

Dane Parchment
MOD
Dane Parchment
Treehouse Moderator 11,075 Points

You didn't close your UserInterface object with the closing curly brace }. Look carefully at your code, the UserInterface object should look like this: var UserInterface = {attribute: value;} what does yours look like?