Therenoth234
Therenoth234

Reputation: 23

SyntaxError: Unexpected Identifier in TwilioQuest

Hey I'm trying to learn JavaScript right now with TwilioQuest and im having problems that I cant seem to fix.

I'm trying to correct the error "SyntaxError: Unexpected Identifier". I'm getting when I try to run this code.

Function getLaserSetting(magicWord) {
    if (magicWord === 'please') {
       return 'OFF';
    } else {
       Return 'ON';
   }
}

const currentSetting = get LaserSetting('please');
console.log('The current laser setting is' + currentSetting);

the original code is:

function getLaserSetting(magicWord) {
  if (magicWord === 'the magic word here') {
    return 'what should this be?';
  } else {
    return 'ON';
  }
}

const currentSetting = getLaserSetting('right now!');
console.log('The current laser setting is: ' + currentSetting);

Upvotes: 2

Views: 220

Answers (1)

Ulianka Shu
Ulianka Shu

Reputation: 131

Function must be written from small letter, Return must start from lowercase, name of variable get LaserSetting must be without spaces.

So, Function -> function, Return -> return, get LaserSetting -> getLaserSetting.

Upvotes: 3

Related Questions