Friday, March 4, 2011

week 2, the others are comming...

Better late than never!... . .  .

After reading chapters 1, 2 and 3 from the book, here are the important bits, I will clear all the theory first and then post for every exercise.

Types are the definition that variables need, in order to know what they represent. The main ones on the are: Numbers, strings, Boolean, objects, functions, and undefined values. This where created so the programs would know when they are using numbers of letters or any other thing on execution, this way it treats 2+2 as an addition or as the string 2+2 (as characters).

For calculations we would lose precision when dealing with too many decimals, it would be a problem if we need that level of precision in calculations, no solutions was presented on this chapters about it, since, most of the time, general calculations fit the limits of JS.

And as Alex pointed out, "as I was taught in Calculus: Multiply First, resolve everything above the division, then divide… its simple arithmetic"

What is the use of a backslash character in a String?, well is to insert special characters, the most common (in all programing languages) is /n as the end of line.

Typeof returs, as the resutl of its operation, a string indicating the type of the value to evaluate, typeof 4.5 tells you that 4.5 is a number, typeof (typeof 4.5) indicates it as a string because the result of typeof 4.5 is the string "number" so the typeof "number" is a string...

and now the exercises.. 

No comments:

Post a Comment