1
Trying to pass this test!! FML! HELP PLEASE
SeanChadwick (1)

I CAN'T FIGURE THIS OUT FOR THE LIFE OF ME AND ITS DRIVING ME A CRAZY..

ok heres the question

**unction exerciseThree(str){
// In this exercise, you will be given a variable, it will be called: str
// On the next line create a variable called 'length' and using the length property assign the new variable to the length of str

var length = 'hello';
var str = 'something';
str.length;

// Please write your answer in the line above.
return length;
}**

So I'm just looking for an answer..i"m completing this to get accepted to lambda full stack course...

the question is telling me to create a variable called length and THEN use the .legnth property to assing the new variable to length of str

my understanding is the .length property will tell you the number of characters and spaces that are used..

so why would i use the length of length to define the .length of str..

AM I LOSING MY MIND or am I just a little stupid (or a lot)

You are viewing a single comment. View All
1
mwilki7 (111)

@SeanChadwick
So they wanted you to use a variable "length" to get the value of str.length
This was kind of pointless because you can just do:

function exerciseThree(str)
{
    return str.length;
}

and not have to worry about other variables.

I've also had a lot of confusion from poorly worded questions so no worries.