Skip to content

Commit f07edd8

Browse files
committed
results keyword has no significance anymore
1 parent 66af413 commit f07edd8

File tree

12 files changed

+38
-32
lines changed

12 files changed

+38
-32
lines changed

functions/array/array_multisort.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,11 @@ function array_multisort (arr) {
66
// * example 2: jobs = {A: 'Warrior', B: 'Thief', C: 'Monk', D: 'Mage', E: 'Knight'};
77
// * example 2: array_multisort(characters, 'SORT_DESC', 'SORT_STRING', jobs, 'SORT_ASC', 'SORT_STRING');
88
// * returns 2: true
9-
// * results 2: characters == {D: 'Terra', C: 'Sabin', B: 'Locke', E: 'Edward', A: 'Edward'};
10-
// * results 2: jobs == {D: 'Mage', C: 'Monk', B: 'Thief', E: 'Knight', A: 'Warrior'};
119
// * example 3: lastnames = [ 'Carter','Adams','Monroe','Tyler','Madison','Kennedy','Adams'];
1210
// * example 3: firstnames = ['James', 'John' ,'James', 'John', 'James', 'John', 'John'];
1311
// * example 3: president = [ 39, 6, 5, 10, 4, 35, 2 ];
1412
// * example 3: array_multisort(firstnames, 'SORT_DESC', 'SORT_STRING', lastnames, 'SORT_ASC', 'SORT_STRING', president, 'SORT_NUMERIC');
1513
// * returns 3: true
16-
// * results 3: firstnames == ['John', 'John', 'John', 'John', 'James', 'James', 'James'];
17-
// * results 3: lastnames == ['Adams','Adams','Kennedy','Tyler','Carter','Madison','Monroe'];
18-
// * results 3: president == [2, 6, 35, 10, 39, 4, 5];
1914
// Fix: this function must be fixed like asort(), etc., to return a (shallow) copy by default, since IE does not support!
2015
// VARIABLE DESCRIPTIONS
2116
//

functions/array/array_pop.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ function array_pop (inputArr) {
1616
// * returns 1: 2
1717
// * example 2: data = {firstName: 'Kevin', surName: 'van Zonneveld'};
1818
// * example 2: lastElem = array_pop(data);
19-
// * returns 2: 'van Zonneveld'
20-
// * results 2: data == {firstName: 'Kevin'}
19+
// * example 2: data
20+
// * returns 2: {firstName: 'Kevin'}
21+
2122
var key = '',
2223
lastKey = '';
2324

functions/array/array_splice.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,13 @@ function array_splice (arr, offst, lgth, replacement) {
1313
// * example 1: input = {4: "red", 'abc': "green", 2: "blue", 'dud': "yellow"};
1414
// * example 1: array_splice(input, 2);
1515
// * returns 1: {0: "blue", 'dud': "yellow"}
16-
// * results 1: input == {'abc':"green", 0:"red"}
1716
// * example 2: input = ["red", "green", "blue", "yellow"];
1817
// * example 2: array_splice(input, 3, 0, "purple");
1918
// * returns 2: []
20-
// * results 2: input == ["red", "green", "blue", "purple", "yellow"]
2119
// * example 3: input = ["red", "green", "blue", "yellow"]
2220
// * example 3: array_splice(input, -1, 1, ["black", "maroon"]);
2321
// * returns 3: ["yellow"]
24-
// * results 3: input == ["red", "green", "blue", "black", "maroon"]
22+
2523
var _checkToUpIndices = function (arr, ct, key) {
2624
// Deal with situation, e.g., if encounter index 4 and try to set it to 0, but 0 exists later in loop (need to
2725
// increment all subsequent (skipping current key, since we need its value below) until find unused)

functions/array/arsort.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ function arsort (inputArr, sort_flags) {
2828
// * example 2: ini_set('phpjs.strictForIn', true);
2929
// * example 2: data = {d: 'lemon', a: 'orange', b: 'banana', c: 'apple'};
3030
// * example 2: arsort(data);
31-
// * results 2: data == {a: 'orange', d: 'lemon', b: 'banana', c: 'apple'}
32-
// * returns 2: true
31+
// * example 2: data;
32+
// * returns 2: {a: 'orange', d: 'lemon', b: 'banana', c: 'apple'}
33+
3334
var valArr = [], valArrLen = 0,
3435
k, i, ret, sorter, that = this,
3536
strictForIn = false,

functions/array/asort.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,14 @@ function asort (inputArr, sort_flags) {
2828
// - depends on: i18n_loc_get_default
2929
// * example 1: data = {d: 'lemon', a: 'orange', b: 'banana', c: 'apple'};
3030
// * example 1: data = asort(data);
31-
// * results 1: data == {c: 'apple', b: 'banana', d: 'lemon', a: 'orange'}
32-
// * returns 1: true
31+
// * example 1: data
32+
// * returns 1: {c: 'apple', b: 'banana', d: 'lemon', a: 'orange'}
3333
// * example 2: ini_set('phpjs.strictForIn', true);
3434
// * example 2: data = {d: 'lemon', a: 'orange', b: 'banana', c: 'apple'};
3535
// * example 2: asort(data);
36-
// * results 2: data == {c: 'apple', b: 'banana', d: 'lemon', a: 'orange'}
37-
// * returns 2: true
36+
// * example 2: data
37+
// * returns 2: {c: 'apple', b: 'banana', d: 'lemon', a: 'orange'}
38+
3839
var valArr = [], valArrLen = 0,
3940
k, i, ret, sorter, that = this,
4041
strictForIn = false,

functions/array/krsort.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@ function krsort (inputArr, sort_flags) {
2020
// - depends on: i18n_loc_get_default
2121
// * example 1: data = {d: 'lemon', a: 'orange', b: 'banana', c: 'apple'};
2222
// * example 1: data = krsort(data);
23-
// * results 1: {d: 'lemon', c: 'apple', b: 'banana', a: 'orange'}
23+
// * example 1: data
24+
// * returns 1: {d: 'lemon', c: 'apple', b: 'banana', a: 'orange'}
2425
// * example 2: ini_set('phpjs.strictForIn', true);
2526
// * example 2: data = {2: 'van', 3: 'Zonneveld', 1: 'Kevin'};
2627
// * example 2: krsort(data);
27-
// * results 2: data == {3: 'Kevin', 2: 'van', 1: 'Zonneveld'}
28-
// * returns 2: true
28+
// * example 2: data
29+
// * returns 2: {3: 'Kevin', 2: 'van', 1: 'Zonneveld'}
30+
2931
var tmp_arr = {},
3032
keys = [],
3133
sorter, i, k, that = this,

functions/array/ksort.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@ function ksort (inputArr, sort_flags) {
2121
// - depends on: strnatcmp
2222
// * example 1: data = {d: 'lemon', a: 'orange', b: 'banana', c: 'apple'};
2323
// * example 1: data = ksort(data);
24-
// * results 1: {a: 'orange', b: 'banana', c: 'apple', d: 'lemon'}
24+
// * example 1: data
25+
// * returns 1: {a: 'orange', b: 'banana', c: 'apple', d: 'lemon'}
2526
// * example 2: ini_set('phpjs.strictForIn', true);
2627
// * example 2: data = {2: 'van', 3: 'Zonneveld', 1: 'Kevin'};
2728
// * example 2: ksort(data);
28-
// * results 2: data == {1: 'Kevin', 2: 'van', 3: 'Zonneveld'}
29-
// * returns 2: true
29+
// * example 2: data
30+
// * returns 2: {1: 'Kevin', 2: 'van', 3: 'Zonneveld'}
31+
3032
var tmp_arr = {},
3133
keys = [],
3234
sorter, i, k, that = this,

functions/array/rsort.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ function rsort (inputArr, sort_flags) {
2525
// * example 2: ini_set('phpjs.strictForIn', true);
2626
// * example 2: fruits = {d: 'lemon', a: 'orange', b: 'banana', c: 'apple'};
2727
// * example 2: rsort(fruits);
28-
// * results 2: fruits == {0: 'orange', 1: 'lemon', 2: 'banana', 3: 'apple'}
29-
// * returns 2: true
28+
// * example 2: fruits;
29+
// * returns 2: {0: 'orange', 1: 'lemon', 2: 'banana', 3: 'apple'}
30+
3031
var valArr = [],
3132
k = '',
3233
i = 0,

functions/array/sort.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ function sort (inputArr, sort_flags) {
2020
// % note 3: if the content is a numeric string, we treat the
2121
// % note 3: "original type" as numeric.
2222
// - depends on: i18n_loc_get_default
23-
// * example 1: sort(['Kevin', 'van', 'Zonneveld']);
23+
// * example 1: var arr = ['Kevin', 'van', 'Zonneveld']
24+
// * example 1: sort(arr);
25+
// * example 1: arr;
2426
// * returns 1: ['Kevin', 'Zonneveld', 'van']
2527
// * example 2: ini_set('phpjs.strictForIn', true);
2628
// * example 2: fruits = {d: 'lemon', a: 'orange', b: 'banana', c: 'apple'};

functions/array/uksort.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ function uksort (inputArr, sorter) {
1414
// % note 2: is by reference in PHP anyways
1515
// * example 1: data = {d: 'lemon', a: 'orange', b: 'banana', c: 'apple'};
1616
// * example 1: data = uksort(data, function (key1, key2){ return (key1 == key2 ? 0 : (key1 > key2 ? 1 : -1)); });
17-
// * results 1: data == {a: 'orange', b: 'banana', c: 'apple', d: 'lemon'}
18-
// * returns 1: true
17+
// * example 1: data
18+
// * returns 1: {a: 'orange', b: 'banana', c: 'apple', d: 'lemon'}
19+
1920
var tmp_arr = {},
2021
keys = [],
2122
i = 0,

functions/datetime/mktime.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ function mktime () {
2525
// * example 3: td = new Date();
2626
// * example 3: real = Math.floor(td.getTime() / 1000);
2727
// * example 3: diff = (real - make);
28-
// * results 3: diff < 5
28+
// * example 3: diff < 5
29+
// * returns 3: true
2930
// * example 4: mktime(0, 0, 0, 13, 1, 1997)
3031
// * returns 4: 883612800
3132
// * example 5: mktime(0, 0, 0, 1, 1, 1998)

functions/var/settype.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ function settype (vr, type) {
77
// % note 2: only works on global variables, and "vr" must be passed in as a string
88
// * example 1: foo = '5bar';
99
// * example 1: settype('foo', 'integer');
10-
// * results 1: foo === 5
11-
// * returns 1: true
10+
// * example 1: foo
11+
// * returns 1: 5
1212
// * example 2: foo = true;
1313
// * example 2: settype('foo', 'string');
14-
// * results 2: foo === '1'
15-
// * returns 2: true
14+
// * example 2: foo
15+
// * returns 2: '1'
16+
1617
var is_array = function (arr) {
1718
return typeof arr === 'object' && typeof arr.length === 'number' && !(arr.propertyIsEnumerable('length')) && typeof arr.splice === 'function';
1819
};

0 commit comments

Comments
 (0)