+ 1
Struggling on JavaScript Control Flow Problem (Updated)
Instructions: Uncomment the if statement and modify the condition in line 4 so the code outputs 'Four score and seven years ago!' if name is set to 'Abraham Lincoln'. ________ 1. 2. var name; 3. var message = 'Hi, ' + name; 4. //if ( ) { 5. // message = 'Four score and seven years ago!'; 6. //} 7. console.log(message); 8. *Requirements: - name should be set to Abraham Lincoln. - message should be Four score and seven years ago! - Please do not modify line 3. - Make sure to uncomment the if statement.
3 Answers
+ 3
maybe something like
if(name = "Abraham Lincoln")
that should execute the if block and assign the string abraham lincoln to name
or if that doesnât work try
if(name = "Abraham Lincoln" || true)
or
if(name="Abraham Lincoln",true)
utilizing the comma operator
0
if (name === "Abraham Lincoln")
0
I've tried plugging in the codes above but still can't get passed this exercise for multiple hours.