+ 5

I have a doubt about objects in JavaScript. Can anyone help please?

When you open the JavaScript course, go to Objects, the open the first course in it, that is, Introducing Objects. In the first course, open the third part, that is, Object Properties. Go to the end of that page, and you'll see an example which states the use of .length. Click on try yourself. Then change course.name.length to course.lessons.length. Then run the code. The output results in undefined. Why does this happen? Can anyone explain me please? Thanks a bunch!👍☺

3rd Jun 2018, 10:21 AM
Rahul Hemdev
Rahul Hemdev - avatar
4 odpowiedzi
+ 3
length PROPERTY ONLY WORKS WITH STRINGS. IT RETURNS NUMBER OF CHARACTER IN A STRING. IT DOESNT WORK WITH NUMBERS.
3rd Jun 2018, 10:30 AM
Meet Mehta
Meet Mehta - avatar
+ 3
Ok..... Thanks!
3rd Jun 2018, 10:34 AM
Rahul Hemdev
Rahul Hemdev - avatar
+ 2
The easiest one is HTML. You can first learn it and then you can move forward to learn other languages.
5th Jun 2018, 2:08 PM
Rahul Hemdev
Rahul Hemdev - avatar
0
pls which of this programming language is the easiest to learn or start with?
5th Jun 2018, 12:23 PM
oluwayemi james