Solutions to exercises in Object-Oriented JavaScript chapters 3 and 4

Since there are no official solutions to the exercises in Stoyan Stefano’s Object-Oriented JavaScript, I’m posting my own here. Hopefully it will be useful to someone. I can’t guarantee their correctness, don’t complain if your teacher/boss gives you a big fat 0 for my answers.

Chapter 3 Functions

Chapter 4 Objects

2 Replies to “Solutions to exercises in Object-Oriented JavaScript chapters 3 and 4”

  1. Hi,

    Could you please tell me how you came with the values
    this.a = 29;
    this.b = 31;
    this.n = 2917;
    in that custom random function?

    Thanks

    1. They are hard coded seeds for the pseudo random generator. Because it’s hard coded, the sequences generated will always be the same. You can pick any numbers you like.

Comments are closed.