This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it("Should reduce", function () { | |
var result; | |
var _ = { | |
reduce: function () { | |
var reduce = function (arr, func) { | |
var i = 0; | |
var len = arr.length; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
describe("Array", function () { | |
it("Array reverse()", function () { | |
expect("sgniht").toBe("things".split("").reverse().join("")); | |
}); | |
it("Array sort()", function () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
window.EhSpy = function (suspect, methodName) { | |
var self = this; | |
self.original = suspect[methodName]; | |
suspect[methodName] = function () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
describe("Array", function () { | |
//part 2 | |
it("Array push()", function () { | |
var arr = []; | |
arr.push(2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
"use strict"; | |
angular.module("exampleApp") | |
.provider("Person", function () { | |
this.$get = [function () { | |
var Person = function (id) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
"use strict"; | |
angular.module("exampleApp") | |
.factory("WebWorks", ["$q", function ($q) { | |
var worker = new Worker('scripts/workers/doWork.js'); | |
var defer; | |
worker.addEventListener('message', function(e) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
"use strict"; | |
var list = [ | |
{ name: "level 1", obs: [ | |
{name: "level 2", obs: [ | |
{name: "level 3 a"}, | |
{name: "level 3 b"} | |
]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
"use strict"; | |
var mixin = function () { | |
var arg, | |
prop, | |
mixedChild = { }, | |
len = arguments.length; | |
for (arg = 0; arg < len; arg ++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var methodMixin = function (func, obj){ | |
var args = Array.prototype.slice.apply(arguments, [2]); | |
return function () { | |
func.apply(obj, args); | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ninja = { | |
chirp: function signal(n) { | |
if (n > 1) { | |
return signal(n-1) + " - chirp"; | |
} | |
else{ | |
return "chirp"; | |
} | |
} |
OlderNewer