Can anyone tell me why the code is not working. I followed the example but I seem to have made a mistake somewhere.
Your code so far
// Example
var firstNameLength = 0;
var firstName = "Ada";
firstNameLength = firstName.length;
// Setup
var lastNameLength = 0;
var lastName = "Lovelace";
// Only change code below this line.
var lastNameLength = 8;
var lastName = "Obsiye";
lastNameLength = lastName.length;
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36.
Hi! I see here you’re trying to reassign the length property to a var containing lastname, to an updated value of lastname.length and youd like that set to 8. The thing is lastname.length is = to 5 .
Obiseye = 5 string characters so i dont think you can reassign it to more characters than the string already contains.
If you’re trying to find the length. Youd simply go
Console.log(lastname.length); for example and it would print to the console 5.