Basic JavaScript - Declare String Variables

I have been stuck on this part for a while now. I have been told that ‘the myFisrtName should be a string with at least one character in it’ and the same goes for the MyLastName.

Your code so far

var myName; /*"myFirstName myLastname"*/;

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Safari/605.1.15

Challenge: Basic JavaScript - Declare String Variables

Link to the challenge:

Well the first portion of the instructions is telling you to create a variable called “myFirstName” and then a second variable called “myLastName”, so I would start there.

2 Likes

can you please elaborate further i’m still stuck

You should start here

Create two new string variables: myFirstName and myLastName

This is a comment, this is not how you create variables.

Look at the example. This is how a variable should be created
var myName;

1 Like

in the exercise they have told to create two variables naming myFirstName and myLastName
the constraints are both variable length should be greater than 1.

const myFirstName = "your first name";
const myLastName = "your last name";
1 Like

You can’t see the wood for the trees. It is sooo simple.

var myName = "your name";
? myFirstName ?
? myLastName ?

Don’t forget the semicolon at the end. And don’t worry! We all get stuck from time to time :smiley:

1 Like

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