27. Why isn't this working?


#1

Why isn't this working?

And yes, I took some creative liberties with my color choice.

var myColor = "booger";
console.log(myColor.length);


27. Conclusion: Part 1
#2

.length() is called with parenthesis.

console.log("moo".length());

#3

@cadecodes, I couldn't find parentheses on .length on MDN; are you sure?

@jhabibi is that your entire program?


#4

I think that is only in Java, not Javascript.


#5

Don't know what the problem was, but it's working now...


#6

@jhabibi sometimes we accidentally reassign built in functions, etc. and then the program won't run properly, which can be resolved by refreshing or opening a new instance of the page. Maybe that's what happened here. Glad to hear it's working now :slight_smile: