FAQ: Introduction to JavaScript - Properties

This community-built FAQ covers the “Properties” exercise from the lesson "Introduction to JavaScript ".

Paths and Courses
This exercise can be found in the following Codecademy content:

Web Development

Introduction To JavaScript

FAQs on the exercise Properties

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

I’m stuck on Intro to JavaScript, Lesson 1 Exxercise 7. I do not get an error message, but I can’t advance. What do I do?

Is this instruction you are stuck on?

Use the .length property to log the number of characters in the following string to the console:

'Teaching the world how to code'
1 Like

I used .length, but I think it is the program. I have reset the exercise several times, reread the text and carefully followed the instructions and used the hint. The program will not let me move forward. What should I do?

This means,

console.log( ... );

so,

console.log("Teaching the world how to code".length);

I created another account and was able to move forward. I’m not sure what the problem was. Thanks

1 Like

I had the same problem. It was my fault, I wrote lenght instead of length.

I am having the same issue. I don’t want to create a new account as I have other lessons I am working on. I know the language fairly well as I have created websites before and used Node.js and React so I know that what I am doing is the correct syntax but it’s not taking it. How do I go about forcing the lesson to pass me?

1 Like

11 posts were split to a new topic: Can’t continue without pressing solution button

Hi, i have done what the exercise has asked me to and passed it… But why is it relevant?.. like why would i want to know how many letters are in the sentence?

Seems like a reasonable question. I’ll try to give a reasonable answer. You might be hosting a message board, and have a character limit per post. This forum, for example has a minimum characters per post limit. As you get further along in learning to code, you’ll come to realize that you use the .length property of different objects quite often.

1 Like

Hello , one basic question :
console.log(“Hello”.length)
.log is a method
.length is a properties

So properties = method ?
else what the difference between ?

A method is an attribute, but that does not make an attribute a method. A method is function, so performs some task. .length is a value, only.

We poll values, and call (or invoke) methods.

hi in this chapter the characters are supposed to be 25 or 30 ?

console.log("Teaching the world how to code".length);

Is that the line you are measuring?

It’s 30 characters because .length counts each space as a character.

m = "23.556"
d = m.substring(m.indexOf('.') + 1).length