|  | 
| 1 | 1 | angular.module("typeCoercion") | 
| 2 |  | -  .factory("DataHolderService", function () { | 
|  | 2 | +  .factory("DataHolderService", function(questions) { | 
| 3 | 3 |     'use strict'; | 
| 4 | 4 |     function shuffle(o) { //v1.0 | 
| 5 | 5 |       for (var j, x, i = o.length; i; j = Math.floor(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x); | 
| 6 | 6 |       return o; | 
| 7 | 7 |     }; | 
| 8 | 8 |     var results = []; | 
| 9 |  | -    var tasks = shuffle([ | 
| 10 |  | -      '1 == 1',     // returns true | 
| 11 |  | -      '"1" == 1',   // returns true ("1" converts to 1) | 
| 12 |  | -      '1 == true',  // returns true | 
| 13 |  | -      '0 == false', // returns true | 
| 14 |  | -      '"" == 0',    // returns true ("" converts to 0) | 
| 15 |  | -      '"  " == 0',  // returns true ("  " converts to 0) | 
| 16 |  | -      '0 == 1',     // returns false | 
| 17 |  | -      '1 == false', // returns false | 
| 18 |  | -      '0 == true',  // returns false | 
| 19 |  | -      '0 != false', // returns false | 
| 20 |  | -      '"" != 0',    // returns false ("" converts to 0) | 
| 21 |  | -      '"  " != 0',  // returns false ("  " converts to 0) | 
| 22 |  | -      '0 != 1',     // returns true | 
| 23 |  | -      '1 != false', // returns true | 
| 24 |  | -      '0 != true',  // returns true | 
| 25 |  | -      '1 === 1',     // returns true | 
| 26 |  | -      '"1" === 1',   // returns false ("1" is not converted) | 
| 27 |  | -      '1 === true',  // returns false | 
| 28 |  | -      '0 === false', // returns false | 
| 29 |  | -      '"" === 0',    // returns false ("" is not converted) | 
| 30 |  | -      '"  " === 0',  // returns false ("  " is not converted) | 
| 31 |  | -      '0 === 1',     // returns false | 
| 32 |  | -      '1 === false', // returns false | 
| 33 |  | -      '0 === true',  // returns false | 
| 34 |  | -      'var x, y;\nx = {};\ny = x;\nx != y //?', // returns false (refers to same object in memory) | 
| 35 |  | -      'var x, y;\nx = {};\ny = x;\nx != {} //?', // returns true (not the same object) | 
| 36 |  | -      'var x, y;\nx = {};\ny = x;\nx == y //?', // returns true (refers to same object in memory) | 
| 37 |  | -      'var x, y;\nx = {};\ny = x;\nx == {} //?', // returns false (not the same object) | 
| 38 |  | -      'var x, y;\nx = {};\ny = x;\nx === y //?', // returns false (not the same object) | 
| 39 |  | -      'var x, y;\nx = {};\ny = x;\nx === {} //?', | 
| 40 |  | -      'if("")', // false | 
| 41 |  | -      'if("5")', // true | 
| 42 |  | -      'if(0)', // false | 
| 43 |  | -      'if(-1)', // true | 
| 44 |  | -      'if(null)', // false | 
| 45 |  | -      'if(undefined)', // false'// returns false (not the same object) | 
| 46 |  | -      'null == undefined', // returns true | 
| 47 |  | -      'null == false', // returns false | 
| 48 |  | -      'NaN == NaN' // returns false | 
| 49 |  | -    ]); | 
|  | 9 | +    var tasks = shuffle(questions); | 
| 50 | 10 | 
 | 
| 51 | 11 |     return { | 
| 52 | 12 |       getTasks: function () { | 
|  | 
0 commit comments