Skip to content

Instantly share code, notes, and snippets.

@rpbaltazar
Forked from jasonm23/Questions.JavaScript.md
Last active August 30, 2018 05:46
Show Gist options
  • Select an option

  • Save rpbaltazar/9afeaabbe112ab74ee04 to your computer and use it in GitHub Desktop.

Select an option

Save rpbaltazar/9afeaabbe112ab74ee04 to your computer and use it in GitHub Desktop.

Revisions

  1. rpbaltazar revised this gist Feb 22, 2016. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions Questions.JavaScript.md
    Original file line number Diff line number Diff line change
    @@ -46,8 +46,8 @@
    console.log(b);
    console.log(a);

    #### 6.1 what will be the value of `b`?
    #### 6.2 What will be the value of `a`?
    #### 6.1 what will be the printed value of `b`?
    #### 6.2 What will be the printed value of `a`?

    ### 7. What will be the value of `a`?

  2. rpbaltazar revised this gist Feb 22, 2016. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions Questions.JavaScript.md
    Original file line number Diff line number Diff line change
    @@ -42,6 +42,9 @@
    var a = 10 * b;
    return a;
    })();

    console.log(b);
    console.log(a);

    #### 6.1 what will be the value of `b`?
    #### 6.2 What will be the value of `a`?
  3. rpbaltazar revised this gist Feb 22, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Questions.JavaScript.md
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@
    var r = undefined;
    a = b = c = 20;
    n = i = r;
    #### 1. What will be the value of `b` after its execution?
    #### 1.1 What will be the value of `b` after its execution?

    ### 2. Describe each part of a `for` loop structure.

  4. rpbaltazar revised this gist Feb 22, 2016. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion Questions.JavaScript.md
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,11 @@
    # JavaScript Developer Questionnaire

    ### 1. What will be the value of `b`?
    ### 1. Examine this `script example`.

    var r = undefined;
    a = b = c = 20;
    n = i = r;
    #### 1. What will be the value of `b` after its execution?

    ### 2. Describe each part of a `for` loop structure.

  5. rpbaltazar revised this gist Feb 11, 2016. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions Questions.JavaScript.md
    Original file line number Diff line number Diff line change
    @@ -20,7 +20,7 @@

    var x = true && true && true && false;

    ### 5. After running the code below:
    ### 5. Consider the following scipt. After running it:

    var x = 0;

    @@ -34,7 +34,7 @@
    #### 5.1 What will be the value of `x`?
    #### 5.2 What will be the value of `z`?

    ### 6. After running the code below:
    ### 6. Consider the following script. After running it:

    (function(){
    b = 20;
    @@ -67,7 +67,7 @@

    var m = /test/.test("I know this is a test");

    ### 12. After running the code below:
    ### 12. Consider the following script. After running it:

    Object.prototype.mush = function(){
    var b = 0, c = [];
  6. rpbaltazar revised this gist Feb 5, 2016. 1 changed file with 3 additions and 4 deletions.
    7 changes: 3 additions & 4 deletions Questions.JavaScript.md
    Original file line number Diff line number Diff line change
    @@ -18,7 +18,7 @@
    #### 3.2 What will be the value of `b`?
    ### 4. After the following code has run what will be the value of `x`?

    var x = false && true && true && true && false || true;
    var x = true && true && true && false;

    ### 5. After running the code below:

    @@ -70,13 +70,12 @@
    ### 12. After running the code below:

    Object.prototype.mush = function(){
    /*var b = 0, c = [];
    var b = 0, c = [];
    if(this instanceof Array){
    b = this.reduce(function(s,i){ return s + i; });
    c = this.map(function(i){ return b; });
    }
    return c;*/
    return [28,28,28,28,28,28,28];
    return c;
    }

    a = [1,2,3,4,5,6,7];
  7. rpbaltazar revised this gist Feb 5, 2016. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions Questions.JavaScript.md
    Original file line number Diff line number Diff line change
    @@ -70,12 +70,13 @@
    ### 12. After running the code below:

    Object.prototype.mush = function(){
    var b = 0, c = [];
    /*var b = 0, c = [];
    if(this instanceof Array){
    b = this.reduce(function(s,i){ return s + i; });
    c = this.map(function(i){ return b; });
    }
    return c;
    return c;*/
    return [28,28,28,28,28,28,28];
    }

    a = [1,2,3,4,5,6,7];
  8. rpbaltazar revised this gist Feb 5, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Questions.JavaScript.md
    Original file line number Diff line number Diff line change
    @@ -18,7 +18,7 @@
    #### 3.2 What will be the value of `b`?
    ### 4. After the following code has run what will be the value of `x`?

    var x = false && true && true && true && false;
    var x = false && true && true && true && false || true;

    ### 5. After running the code below:

  9. rpbaltazar revised this gist Feb 5, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Questions.JavaScript.md
    Original file line number Diff line number Diff line change
    @@ -9,7 +9,7 @@
    ### 2. Describe each part of a `for` loop structure.

    ### 3. Examine this `script example`.
    var n = 10;

    for(i = 0; i < n; i++){
    b = i;
    }
  10. rpbaltazar revised this gist Feb 5, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Questions.JavaScript.md
    Original file line number Diff line number Diff line change
    @@ -9,7 +9,7 @@
    ### 2. Describe each part of a `for` loop structure.

    ### 3. Examine this `script example`.

    var n = 10;
    for(i = 0; i < n; i++){
    b = i;
    }
  11. rpbaltazar revised this gist Feb 5, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Questions.JavaScript.md
    Original file line number Diff line number Diff line change
    @@ -18,7 +18,7 @@
    #### 3.2 What will be the value of `b`?
    ### 4. After the following code has run what will be the value of `x`?

    var x = true && true && true && false;
    var x = false && true && true && true && false;

    ### 5. After running the code below:

  12. rpbaltazar revised this gist Feb 4, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Questions.JavaScript.md
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,7 @@

    ### 2. Describe each part of a `for` loop structure.

    ### 3. Examine this `for` loop.
    ### 3. Examine this `script example`.

    for(i = 0; i < n; i++){
    b = i;
  13. @jasonm23 jasonm23 revised this gist Jun 20, 2014. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions Questions.JavaScript.md
    Original file line number Diff line number Diff line change
    @@ -20,7 +20,7 @@

    var x = true && true && true && false;

    ### 5. After the following code has run...
    ### 5. After running the code below:

    var x = 0;

    @@ -34,7 +34,7 @@
    #### 5.1 What will be the value of `x`?
    #### 5.2 What will be the value of `z`?

    ### 6. After the following code has run
    ### 6. After running the code below:

    (function(){
    b = 20;
  14. @jasonm23 jasonm23 revised this gist Jun 20, 2014. 1 changed file with 12 additions and 9 deletions.
    21 changes: 12 additions & 9 deletions Questions.JavaScript.md
    Original file line number Diff line number Diff line change
    @@ -9,20 +9,18 @@
    ### 2. Describe each part of a `for` loop structure.

    ### 3. Examine this `for` loop.
    #### 3.1 Explain at least 3 things wrong with it.
    #### 3.2 What will be the value of `b`?

    for(i = 0; i < n; i++){
    b = i;
    }

    #### 3.1 Explain at least 3 things wrong with it.
    #### 3.2 What will be the value of `b`?
    ### 4. After the following code has run what will be the value of `x`?

    var x = true && true && true && false;

    ### 5. After the following code has run...
    #### 5.1 What will be the value of `x`?
    #### 5.2 What will be the value of `z`?

    var x = 0;

    @@ -33,16 +31,20 @@

    var z = multiply(20, 10);

    #### 5.1 What will be the value of `x`?
    #### 5.2 What will be the value of `z`?

    ### 6. After the following code has run
    #### 6.1 what will be the value of `b`?
    #### 6.2 What will be the value of `a`?

    (function(){
    b = 20;
    var a = 10 * b;
    return a;
    })();

    #### 6.1 what will be the value of `b`?
    #### 6.2 What will be the value of `a`?

    ### 7. What will be the value of `a`?

    a = 10;
    @@ -66,9 +68,6 @@
    var m = /test/.test("I know this is a test");

    ### 12. After running the code below:
    #### 12.1 What will be the value of `b`?
    #### 12.2 What will be the value of `a.mush()[2]`?
    #### 12.3 What will be the value of `b == a.mush()[2]`

    Object.prototype.mush = function(){
    var b = 0, c = [];
    @@ -84,3 +83,7 @@
    a.mush();

    b = a[2];

    #### 12.1 What will be the value of `b`?
    #### 12.2 What will be the value of `a.mush()[2]`?
    #### 12.3 What will be the value of `b == a.mush()[2]`
  15. @jasonm23 jasonm23 revised this gist Jun 20, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Questions.JavaScript.md
    Original file line number Diff line number Diff line change
    @@ -18,7 +18,7 @@

    ### 4. After the following code has run what will be the value of `x`?

    var x = true && true && true && false;
    var x = true && true && true && false;

    ### 5. After the following code has run...
    #### 5.1 What will be the value of `x`?
  16. @jasonm23 jasonm23 revised this gist Jun 20, 2014. 1 changed file with 8 additions and 4 deletions.
    12 changes: 8 additions & 4 deletions Questions.JavaScript.md
    Original file line number Diff line number Diff line change
    @@ -8,16 +8,20 @@

    ### 2. Describe each part of a `for` loop structure.

    ### 3. Explain at least 3 things wrong with this `for` loop.
    ### 3. Examine this `for` loop.
    #### 3.1 Explain at least 3 things wrong with it.
    #### 3.2 What will be the value of `b`?

    for(i = 0; i < n; i++){
    b = i;
    }

    ### 4. What is the value of `b`?
    ### 4. After the following code has run what will be the value of `x`?

    ### 5. After the code has run
    #### 5.1 what will be the value of `x`?
    var x = true && true && true && false;

    ### 5. After the following code has run...
    #### 5.1 What will be the value of `x`?
    #### 5.2 What will be the value of `z`?

    var x = 0;
  17. @jasonm23 jasonm23 revised this gist Jun 20, 2014. 1 changed file with 12 additions and 12 deletions.
    24 changes: 12 additions & 12 deletions Questions.JavaScript.md
    Original file line number Diff line number Diff line change
    @@ -1,22 +1,22 @@
    # JavaScript Developer Questionnaire

    ### 1 What will be the value of `b`?
    ### 1. What will be the value of `b`?

    var r = undefined;
    a = b = c = 20;
    n = i = r;

    ### 2 Describe each part of a `for` loop structure.
    ### 2. Describe each part of a `for` loop structure.

    ### 3 Explain at least 3 things wrong with this `for` loop.
    ### 3. Explain at least 3 things wrong with this `for` loop.

    for(i = 0; i < n; i++){
    b = i;
    }

    ### 4 What is the value of `b`?
    ### 4. What is the value of `b`?

    ### 5 After the code has run
    ### 5. After the code has run
    #### 5.1 what will be the value of `x`?
    #### 5.2 What will be the value of `z`?

    @@ -29,7 +29,7 @@

    var z = multiply(20, 10);

    ### 6 After the following code has run
    ### 6. After the following code has run
    #### 6.1 what will be the value of `b`?
    #### 6.2 What will be the value of `a`?

    @@ -39,29 +39,29 @@
    return a;
    })();

    ### 7 What will be the value of `a`?
    ### 7. What will be the value of `a`?

    a = 10;
    a /= 2;

    ### 8 What will be the value of `a['foo']`?
    ### 8. What will be the value of `a['foo']`?

    var a = { bar: 10, baz: 20, foo: 40 };
    a.foo += a.bar;

    ### 9 What will be the value of `a[3]`?
    ### 9. What will be the value of `a[3]`?

    var a = "I ran all the way home";

    ### 10 What will be the value of `b[3]`?
    ### 10. What will be the value of `b[3]`?

    var b = "I ran all the way home".split(' ');

    ### 11 What will be the value of `m`?
    ### 11. What will be the value of `m`?

    var m = /test/.test("I know this is a test");

    ### 12 After running the code below:
    ### 12. After running the code below:
    #### 12.1 What will be the value of `b`?
    #### 12.2 What will be the value of `a.mush()[2]`?
    #### 12.3 What will be the value of `b == a.mush()[2]`
  18. @jasonm23 jasonm23 revised this gist Jun 20, 2014. 1 changed file with 19 additions and 17 deletions.
    36 changes: 19 additions & 17 deletions Questions.JavaScript.md
    Original file line number Diff line number Diff line change
    @@ -1,22 +1,24 @@
    # JavaScript Developer Questionnaire

    ### 1) What will be the value of `b`?
    ### 1 What will be the value of `b`?

    var r = undefined;
    a = b = c = 20;
    n = i = r;

    ### 2) Describe each part of a `for` loop structure.
    ### 2 Describe each part of a `for` loop structure.

    ### 3) Explain at least 3 things wrong with this `for` loop.
    ### 3 Explain at least 3 things wrong with this `for` loop.

    for(i = 0; i < n; i++){
    b = i;
    }

    ### 4) What is the value of `b`?
    ### 4 What is the value of `b`?

    ### 5) After the code has run, what will be the value of `x`? What will be the value of `z`?
    ### 5 After the code has run
    #### 5.1 what will be the value of `x`?
    #### 5.2 What will be the value of `z`?

    var x = 0;

    @@ -27,42 +29,42 @@

    var z = multiply(20, 10);


    ### 6) After the following code has run, what will be the value of `b`? What will be the value of `a`?

    ### 6 After the following code has run
    #### 6.1 what will be the value of `b`?
    #### 6.2 What will be the value of `a`?

    (function(){
    b = 20;
    var a = 10 * b;
    return a;
    })();


    ### 7) What will be the value of `a`?

    ### 7 What will be the value of `a`?

    a = 10;
    a /= 2;


    ### 8) What will be the value of `a['foo']`?
    ### 8 What will be the value of `a['foo']`?

    var a = { bar: 10, baz: 20, foo: 40 };
    a.foo += a.bar;

    ### 8) What will be the value of `a[3]`?
    ### 9 What will be the value of `a[3]`?

    var a = "I ran all the way home";

    ### 9) What will be the value of `b[3]`?
    ### 10 What will be the value of `b[3]`?

    var b = "I ran all the way home".split(' ');

    ### 10) What will be the value of `m`?
    ### 11 What will be the value of `m`?

    var m = /test/.test("I know this is a test");

    ### 11) What will be the value of `b`? What will be the value of `a.mush()[2]`?
    ### 12 After running the code below:
    #### 12.1 What will be the value of `b`?
    #### 12.2 What will be the value of `a.mush()[2]`?
    #### 12.3 What will be the value of `b == a.mush()[2]`

    Object.prototype.mush = function(){
    var b = 0, c = [];
  19. @jasonm23 jasonm23 revised this gist Jun 20, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Questions.JavaScript.md
    Original file line number Diff line number Diff line change
    @@ -16,7 +16,7 @@

    ### 4) What is the value of `b`?

    ### 5) What will be the value of `x`?
    ### 5) After the code has run, what will be the value of `x`? What will be the value of `z`?

    var x = 0;

  20. @jasonm23 jasonm23 revised this gist Jun 20, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Questions.JavaScript.md
    Original file line number Diff line number Diff line change
    @@ -28,7 +28,7 @@
    var z = multiply(20, 10);


    ### 6) What will be the value of `b`? What will be the value of `a`?
    ### 6) After the following code has run, what will be the value of `b`? What will be the value of `a`?


    (function(){
  21. @jasonm23 jasonm23 revised this gist Jun 20, 2014. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions Questions.JavaScript.md
    Original file line number Diff line number Diff line change
    @@ -34,6 +34,7 @@
    (function(){
    b = 20;
    var a = 10 * b;
    return a;
    })();


  22. @jasonm23 jasonm23 revised this gist Jun 20, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Questions.JavaScript.md
    Original file line number Diff line number Diff line change
    @@ -14,7 +14,7 @@
    b = i;
    }

    ### 4) What is the final value of `b`?
    ### 4) What is the value of `b`?

    ### 5) What will be the value of `x`?

  23. @jasonm23 jasonm23 revised this gist Jun 20, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Questions.JavaScript.md
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,7 @@

    ### 2) Describe each part of a `for` loop structure.

    ### 3) Explain at least 3 things wrong this `for` loop.
    ### 3) Explain at least 3 things wrong with this `for` loop.

    for(i = 0; i < n; i++){
    b = i;
  24. @jasonm23 jasonm23 revised this gist Jun 20, 2014. 1 changed file with 9 additions and 19 deletions.
    28 changes: 9 additions & 19 deletions Questions.JavaScript.md
    Original file line number Diff line number Diff line change
    @@ -1,24 +1,23 @@
    # JavaScript Developer Questionnaire

    ### 1) What is the value of `b`?
    ### 1) What will be the value of `b`?

    var r = undefined;
    a = b = c = 20;
    n = i = r;

    ### 2) Describe each part of a `for` loop structure.

    ### 3) Explain at least 3 things wrong this for loop.
    ### 3) Explain at least 3 things wrong this `for` loop.

    for(i = 0; i < n; i++){
    b = i;
    }

    ### 4) What willl be the final value of `b`?
    ### 4) What is the final value of `b`?

    ### 5) What will be the value of `x`?


    var x = 0;

    function multiply(a, b){
    @@ -38,40 +37,31 @@
    })();


    ### 7) What will the value of `a`?
    ### 7) What will be the value of `a`?


    a = 10;
    a /= 2;


    ### 8) What is the value of `a['foo']`?

    ### 8) What will be the value of `a['foo']`?

    var a = { bar: 10, baz: 20, foo: 40 };
    a.foo += a.bar;


    ### 8) What is the value of `a[3]`?

    ### 8) What will be the value of `a[3]`?

    var a = "I ran all the way home";


    ### 9) What is the value of `b[3]`?

    ### 9) What will be the value of `b[3]`?

    var b = "I ran all the way home".split(' ');


    ### 10) What is the value of `m`?

    ### 10) What will be the value of `m`?

    var m = /test/.test("I know this is a test");


    ### 11) What is the value of `b`? What is the value of `a.mush()[2]`?

    ### 11) What will be the value of `b`? What will be the value of `a.mush()[2]`?

    Object.prototype.mush = function(){
    var b = 0, c = [];
  25. @jasonm23 jasonm23 revised this gist Jun 20, 2014. 1 changed file with 9 additions and 9 deletions.
    18 changes: 9 additions & 9 deletions Questions.JavaScript.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # JavaScript Developer Questionnaire

    ### 1) What is the value of `b`
    ### 1) What is the value of `b`?

    var r = undefined;
    a = b = c = 20;
    @@ -14,9 +14,9 @@
    b = i;
    }

    ### 4) What willl be the final value of `b`.
    ### 4) What willl be the final value of `b`?

    ### 4) After running the following code, what will be the value of `x`.
    ### 5) What will be the value of `x`?


    var x = 0;
    @@ -29,7 +29,7 @@
    var z = multiply(20, 10);


    ### 5) After running the following code what will be the value of `b`? what will be the value of `a`?
    ### 6) What will be the value of `b`? What will be the value of `a`?


    (function(){
    @@ -38,33 +38,33 @@
    })();


    ### 6) What will the value of `a` be after running the following code?
    ### 7) What will the value of `a`?


    a = 10;
    a /= 2;


    ### 7) What is the value of `a['foo']` after running the following code?
    ### 8) What is the value of `a['foo']`?


    var a = { bar: 10, baz: 20, foo: 40 };
    a.foo += a.bar;


    ### 8) What is the value of `a[3]` after running the following code?
    ### 8) What is the value of `a[3]`?


    var a = "I ran all the way home";


    ### 9) What is the value of `b[3]` after running the following code?
    ### 9) What is the value of `b[3]`?


    var b = "I ran all the way home".split(' ');


    ### 10) What is the value of `m` after running the following code?
    ### 10) What is the value of `m`?


    var m = /test/.test("I know this is a test");
  26. @jasonm23 jasonm23 revised this gist Jun 20, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Questions.JavaScript.md
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,7 @@
    a = b = c = 20;
    n = i = r;

    ### 2) Describe each part of the `for` loop structure.
    ### 2) Describe each part of a `for` loop structure.

    ### 3) Explain at least 3 things wrong this for loop.

  27. @jasonm23 jasonm23 revised this gist Jun 20, 2014. 1 changed file with 12 additions and 12 deletions.
    24 changes: 12 additions & 12 deletions Questions.JavaScript.md
    Original file line number Diff line number Diff line change
    @@ -1,22 +1,22 @@
    # JavaScript Developer Questionnaire

    ### (1) What is the value of `b`
    ### 1) What is the value of `b`

    var r = undefined;
    a = b = c = 20;
    n = i = r;

    ### (2) Describe each part of the `for` loop structure.
    ### 2) Describe each part of the `for` loop structure.

    ### (3) Explain at least 3 things wrong this for loop.
    ### 3) Explain at least 3 things wrong this for loop.

    for(i = 0; i < n; i++){
    b = i;
    }

    ### (4) What willl be the final value of `b`.
    ### 4) What willl be the final value of `b`.

    ### (4) After running the following code, what will be the value of `x`.
    ### 4) After running the following code, what will be the value of `x`.


    var x = 0;
    @@ -29,7 +29,7 @@
    var z = multiply(20, 10);


    ### (5) After running the following code what will be the value of `b`? what will be the value of `a`?
    ### 5) After running the following code what will be the value of `b`? what will be the value of `a`?


    (function(){
    @@ -38,39 +38,39 @@
    })();


    ### (6) What will the value of `a` be after running the following code?
    ### 6) What will the value of `a` be after running the following code?


    a = 10;
    a /= 2;


    ### (7) What is the value of `a['foo']` after running the following code?
    ### 7) What is the value of `a['foo']` after running the following code?


    var a = { bar: 10, baz: 20, foo: 40 };
    a.foo += a.bar;


    ### (8) What is the value of `a[3]` after running the following code?
    ### 8) What is the value of `a[3]` after running the following code?


    var a = "I ran all the way home";


    ### (9) What is the value of `b[3]` after running the following code?
    ### 9) What is the value of `b[3]` after running the following code?


    var b = "I ran all the way home".split(' ');


    ### (10) What is the value of `m` after running the following code?
    ### 10) What is the value of `m` after running the following code?


    var m = /test/.test("I know this is a test");


    ### (11) What is the value of `b`? What is the value of `a.mush()[2]`?
    ### 11) What is the value of `b`? What is the value of `a.mush()[2]`?


    Object.prototype.mush = function(){
  28. @jasonm23 jasonm23 created this gist Jun 20, 2014.
    89 changes: 89 additions & 0 deletions Questions.JavaScript.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,89 @@
    # JavaScript Developer Questionnaire

    ### (1) What is the value of `b`

    var r = undefined;
    a = b = c = 20;
    n = i = r;

    ### (2) Describe each part of the `for` loop structure.

    ### (3) Explain at least 3 things wrong this for loop.

    for(i = 0; i < n; i++){
    b = i;
    }

    ### (4) What willl be the final value of `b`.

    ### (4) After running the following code, what will be the value of `x`.


    var x = 0;

    function multiply(a, b){
    var x = a * b;
    return x;
    }

    var z = multiply(20, 10);


    ### (5) After running the following code what will be the value of `b`? what will be the value of `a`?


    (function(){
    b = 20;
    var a = 10 * b;
    })();


    ### (6) What will the value of `a` be after running the following code?


    a = 10;
    a /= 2;


    ### (7) What is the value of `a['foo']` after running the following code?


    var a = { bar: 10, baz: 20, foo: 40 };
    a.foo += a.bar;


    ### (8) What is the value of `a[3]` after running the following code?


    var a = "I ran all the way home";


    ### (9) What is the value of `b[3]` after running the following code?


    var b = "I ran all the way home".split(' ');


    ### (10) What is the value of `m` after running the following code?


    var m = /test/.test("I know this is a test");


    ### (11) What is the value of `b`? What is the value of `a.mush()[2]`?


    Object.prototype.mush = function(){
    var b = 0, c = [];
    if(this instanceof Array){
    b = this.reduce(function(s,i){ return s + i; });
    c = this.map(function(i){ return b; });
    }
    return c;
    }

    a = [1,2,3,4,5,6,7];

    a.mush();

    b = a[2];