Lines Matching refs:sum
37 function sum() { function
38 var sum = arguments[0];
40 sum += arguments[i];
42 return sum;
45 assertEquals(void 0, sum(...""));
46 assertEquals(void 0, sum(...[]));
47 assertEquals(void 0, sum(...new Set));
48 assertEquals(void 0, sum(...(function*() { })()));
50 assertEquals("test", sum(..."test"));
51 assertEquals(10, sum(...[1, 2, 3, 4]));
52 assertEquals(10, sum(...[1, 2, 3], 4));
53 assertEquals(10, sum(1, ...[2, 3], 4));
54 assertEquals(10, sum(1, ...[2, 3], ...[4]));
55 assertEquals(10, sum(1, 2, ...[3, 4]));
56 assertEquals(10, sum(...new Set([1, 2, 3, 4])));
57 assertEquals(10, sum(...(function*() {
72 assertEquals(10, sum(...makeArray(...[1, 2, 3, 4])));
73 assertEquals("test!!!", sum(...makeArray(..."test!!!")));
76 assertEquals(36, sum(0, ...[1], 2, 3, ...[4, 5], 6, 7, 8));
77 assertEquals(45, sum(0, ...[1], 2, 3, ...[4, 5], 6, 7, 8, ...[9]));
83 sum: sum, property
89 sum: sum, property
125 assertEquals(void 0, O.sum(...""));
126 assertEquals(void 0, O.sum(...[]));
127 assertEquals(void 0, O.sum(...new Set));
128 assertEquals(void 0, O.sum(...(function*() { })()));
130 assertEquals("test", O.sum(..."test"));
131 assertEquals(10, O.sum(...[1, 2, 3, 4]));
132 assertEquals(10, O.sum(...[1, 2, 3], 4));
133 assertEquals(10, O.sum(1, ...[2, 3], 4));
134 assertEquals(10, O.sum(1, ...[2, 3], ...[4]));
135 assertEquals(10, O.sum(1, 2, ...[3, 4]));
136 assertEquals(10, O.sum(...new Set([1, 2, 3, 4])));
137 assertEquals(10, O.sum(...(function*() {
145 assertEquals(10, O.sum(...O.makeArray(...[1, 2, 3, 4])));
146 assertEquals("test!!!", O.sum(...O.makeArray(..."test!!!")));
149 assertEquals(36, O.sum(0, ...[1], 2, 3, ...[4, 5], 6, 7, 8));
150 assertEquals(45, O.sum(0, ...[1], 2, 3, ...[4, 5], 6, 7, 8, ...[9]));
189 function sum() { function
190 var sum = arguments[0];
192 sum += arguments[i];
194 return sum;
197 assertEquals(void 0, sum(...""));
198 assertEquals(void 0, sum(...[]));
199 assertEquals(void 0, sum(...new Set));
200 assertEquals(void 0, sum(...(function*() { })()));
202 assertEquals("test", sum(..."test"));
203 assertEquals(10, sum(...[1, 2, 3, 4]));
204 assertEquals(10, sum(...[1, 2, 3], 4));
205 assertEquals(10, sum(1, ...[2, 3], 4));
206 assertEquals(10, sum(1, ...[2, 3], ...[4]));
207 assertEquals(10, sum(1, 2, ...[3, 4]));
208 assertEquals(10, sum(...new Set([1, 2, 3, 4])));
209 assertEquals(10, sum(...(function*() {
224 assertEquals(10, sum(...makeArray(...[1, 2, 3, 4])));
225 assertEquals("test!!!", sum(...makeArray(..."test!!!")));
228 assertEquals(36, sum(0, ...[1], 2, 3, ...[4, 5], 6, 7, 8));
229 assertEquals(45, sum(0, ...[1], 2, 3, ...[4, 5], 6, 7, 8, ...[9]));
235 sum: sum, property
241 sum: sum, property
280 assertEquals(void 0, O.sum(...""));
281 assertEquals(void 0, O.sum(...[]));
282 assertEquals(void 0, O.sum(...new Set));
283 assertEquals(void 0, O.sum(...(function*() { })()));
285 assertEquals("test", O.sum(..."test"));
286 assertEquals(10, O.sum(...[1, 2, 3, 4]));
287 assertEquals(10, O.sum(...[1, 2, 3], 4));
288 assertEquals(10, O.sum(1, ...[2, 3], 4));
289 assertEquals(10, O.sum(1, ...[2, 3], ...[4]));
290 assertEquals(10, O.sum(1, 2, ...[3, 4]));
291 assertEquals(10, O.sum(...new Set([1, 2, 3, 4])));
292 assertEquals(10, O.sum(...(function*() {
300 assertEquals(10, O.sum(...O.makeArray(...[1, 2, 3, 4])));
301 assertEquals("test!!!", O.sum(...O.makeArray(..."test!!!")));
304 assertEquals(36, O.sum(0, ...[1], 2, 3, ...[4, 5], 6, 7, 8));
305 assertEquals(45, O.sum(0, ...[1], 2, 3, ...[4, 5], 6, 7, 8, ...[9]));