25. Just felt like this one was kind of confusing


#1

My confusion was why it did not even mention using .length in this lesson


25/28 How to use variables
#2

Are you sure that you are looking at the same exercise that we are?

// Use console.log to print out the length of the variable myCountry.
console.log( );

#3

Yes, Lesson 25. I get it says length but it does not say to type ".length". ok let me clarify. Imagine this is someone's very first language. It even says "Getting Started with Javascript".
It's fine since I figured it out but I came to the forum to see if anyone else had trouble with this exercise and sure enough...just felt like this one was kind of confusing all the previous lessons were quite easy.

think I was typing console.log(myCountry.substring(0,3) ); instead of .length


#4

@dcofjapan,

Javascript is an object-oriented language.

An object has one or more properties, separated by a comma_,

A property has a property-key and it's associated VALUE

The **VALUE** can be anything from:

•Number
•String
•Boolean
•Symbol
•Object  ◦Function
         ◦Array
         ◦Date
         ◦RegExp
         ◦Math
•Null
•Undefined

For every of the Data-types you can find a set of predefined-functions also called Methods
Every Data-type has its so-called prototype, and is there that the Methods can be found
== try with google search ==
javascript string.prototype site:developer.mozilla.org

As you are programming
you are trying to create a copy of the reality
using DATA to create INFORMATION

You will use Statement's
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements
and use conditions in the FLOW-CONTROL
using expressions and operators
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators.

As guidance to a coding-convention use Crockfords...
http://javascript.crockford.com/code.html

So in short

Reference

google search
== the Book ==
javascript [your question] site:developer.mozilla.org

== discussions / opinions ==
javascript [your question] site:stackoverflow.com

== guidance ==
www.crockford.com
= http://javascript.crockford.com/code.html
= http://javascript.crockford.com/survey.html

= https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript
= www.developer.mozilla.org/en-US/docs/Web/JavaScript/Guide


#5

I think I see what you mean. People tend to rush through some of these exercises, especially the easy ones. I don't think they absorb what they are doing.

The writer of exercise 25 likely expected us to remember what we did in exercise 2 "Discover the length".