4/8 this works but is it correct?


#1

var friends = new Object();
friends.bill = new Object();
friends.bill.firstName = "Bill";
friends.bill.lastName = "Samson";
friends.bill.number = 404-212-8135;

friends.steve = new Object();
    friends.steve.firstName = "Steve";
    friends.steve.lastName = "[Edit]";
    friends.steve.number = 712-342-2345;

#2

In reality, it does work, but it is not correct. Consider,

404-212-8135
712-342-2345

When we poll friends.bill.number we get -7943 and when we poll friends.steve.number we get, -1975. This is the result of repeated subtraction as without quotes, those numbers are arithmetic expressions that JS will solve before displaying the outcome. Telephone numbers should be treated as strings, and wrapped in quotes.