Editing 5cp This edit will create a new revision. Your details (optional) Name Email (won’t be displayed; might be used for Gravatar) URL Test case details Title * Published (uncheck if you want to fiddle around before making the page public) Description (in case you feel further explanation is needed)(Markdown syntax is allowed) Are you a spammer? (just answer the question) Preparation code Preparation code HTML (this will be inserted in the <body> of a valid HTML5 document in standards mode) (useful when testing DOM operations or including libraries) Include JavaScript libraries as follows: <script src="//cdn.ext/library.js"></script> Define setup for all tests (variables, functions, arrays or other objects that will be used in the tests) (runs before each clocked test loop, outside of the timed code region) (e.g. define local test variables, reset global variables, clear canvas, etc.) (see FAQ) function copyFive(obj, a, b, c, d, e, f) { obj = obj || {}; if (window.__DEV__) { if (f) { throw new Error('Too many'); } } var args = [a, b, c, d, e]; var ii = 0, v; while (args[ii]) { v = args[ii++]; for (var k in v) { obj[k] = v[k]; } if (v.hasOwnProperty && v.hasOwnProperty('toString') && (typeof v.toString != 'undefined') && (obj.toString !== v.toString)) { obj.toString = v.toString; } } return obj; } function copyWhatever(obj) { obj = obj || {}; if (window.__DEV__) { if (f) { throw new Error('Too many arguments passed to copyProperties'); } } var args = arguments; var ii = 1, v; while (args[ii]) { v = args[ii++]; for (var k in v) { obj[k] = v[k]; } if (v.hasOwnProperty && v.hasOwnProperty('toString') && (typeof v.toString != 'undefined') && (obj.toString !== v.toString)) { obj.toString = v.toString; } } return obj; } var o = { name: "Kirk", family: "Hammet", plays: function() { return "mewawwwyee"; } }; var a = {aa:1,ab:2,ac:3}; var b = {ab:1,bb:2,bc:3}; var c = {ca:1,cb:2,cc:3}; var d = {da:1,db:2,dc:3}; var e = {ea:1,eb:2,ec:3}; Define teardown for all tests (runs after each clocked test loop, outside of the timed code region) (see FAQ) Code snippets to compare Test 1 Title Async (check if this is an asynchronous test) Code copyFive(o, a); Test 2 Title Async (check if this is an asynchronous test) Code copyWhatever(o, a); Test 3 Title Async (check if this is an asynchronous test) Code copyFive(o,a,b,c,d,e); Test 4 Title Async (check if this is an asynchronous test) Code copyWhatever(o,a,b,c,d,e);