Javascript (ljs) is the GENERIC language of browser-javascript (ljb, client-side), Node-javascript (ljn, server-side), desktop-javascript (ljd) and other differentiations.
Javascript was originally developed in {1995} by Brendan-Eich, at Netscape-Communications-Corporation. [en.wikipedia.org]
My goal here is my text to be MONOSEMANTIC as possible, in contrast to existing texts, by defining most of the-names of my sentences.
ALSO, my text differs than the traditional one.
I publish STRUCTURED-CONCEPTS|ModelConceptStructureds (MCS) in contrast to traditional text, that describes concepts.
This is a living concept (= an evolving concept), see and reference by version.
Last-version is dynamic (do not reference with it), all others are static.
Even though the-work I have-put on this webpage-concept is NOT a small amount, much more is-needed.
Name::
* cpt.Language.javascript-(Ljs),
* cpt.Ljs-(LanguageJavaScript),
* cpt.JavaScript,
* cpt.Javascript-(Ljs),
* cpt.Js-(Javascript),
History-of-name:
Although it was developed under the name Mocha, the language was officially called LiveScript when it first shipped in beta releases of Netscape Navigator 2.0 in September 1995, but it was renamed JavaScript when it was deployed in the Netscape browser version 2.0B3.
The change of name from LiveScript to javascript roughly coincided with Netscape adding support for Java technology in its Netscape Navigator Web browser.
The final choice of name caused confusion, giving the impression that the language was a spin-off of the Java programming language, and the choice has been characterized as a marketing ploy by Netscape to give javascript the cachet of what was then the hot new Web programming language.
[https://en.wikipedia.org/wiki/javascript#Beginnings_at_Netscape]
"JavaScript" is a trademark of Oracle Corporation.
It is used under license for technology invented and implemented by Netscape Communications and current entities such as the Mozilla Foundation.
[https://en.wikipedia.org/wiki/JavaScript#Trademark]
===
THEN, JavaScript (with JS capital) is the-javascript of Mozilla.
I am-using the-names 'javascript' and 'ljs' for the generic language.
[HmnSgm.2016-07-22]
Generic-chain::
* programing-language,
* computer-language,
* mapping-method,
* method,
* info,
* model,
* entity,
Description::
Information processing by humans.
All languages, human and computer, MAP (represent | translate) one entity (the-archetype) to another (model|code|algorithm), for a-communication reason.
Programing-languages map human-information and human-information-processing in a-format that machines can process.
A-programer MUST-KNOW an-archetype first, in order to create a-program.
Name::
* cpt.Ljs-archetype,
* cpt.Ljs-archo,
* cpt.Ljs-problem,
Specific::
* Ljb-archetype,
* Ljn-archetype,
Description::
Information processing by machines.
An-archetype[1] in programming-languages, usually, is an-expression of processing information by humans.
In order to do this process a-machine, a-programer must translate|represent it[1] in a-format with a-programing-language's constructs.
This representation (model) is an-algorithm.
The-programer first is-thinking the-algorithm in his native-natural-language, but writes down it in a-format that machines understand, the-code.
An-algorithm is a-document with a whole-part-tree structure, the-syntax-tree.
Name::
* cpt.Ljs-algorithm,
* cpt.Ljs-model,
* cpt.Ljs-algo,
* cpt.Ljs-doc,
* cpt.Ljs-doc,
Description::
An-algorithm can-be-written in many formats, natural-language, flowchart, code.
All formats represent information (archetypes) that machines can PROCESS but machines do-not-UNDERSTAND, at least today, all formats and this is the-reason for programing-languages existence.
Natural-language is a human-friendly format, but unfriendly for the-machines.
Flowchart, is a graphical format, like the natural-language format.
Code, is the-format that programing-language define and understand the-machines.
Name::
* cpt.Ljs-algo--format,
* cpt.Ljs-algo--format,
* cpt.Ljs-algo--format,
Specific::
* Natural-language,
* Flowchart,
* Code,
* Web-IDL,
Description::
The-code[1] is a-format of an-algorithm that is-understood both by humans and machines and it[1] is-defined by the-language.
Name::
* cpt.Ljs-code,
* cpt.Ljs-code,
* cpt.Ljs-code-format,
* cpt.Ljs-source-code,
* cpt.Ljs-cod,
* cpt.Source-code-of-ljs,
Description::
An-algorithm is a-MODEL of an-archetype constructed as the-language defines.
THE-STRUCTURE of an-algorithm is a-WHOLE-PART-TREE of units, semantic-units, phrases, sentences, sections of the-language which parts we define in the-next sections.
This whole-part-tree is the-syntax-tree of an-algorithm.
In contrast, the-API of the-language, is structured in a-whole-part-tree and in a-generic-part-tree.
Name::
* cpt.Ljs-algorithm-tree,
* cpt.Ljs-syntax-tree,
* cpt.Ljs-syntax-whole-part-tree,
* cpt.Ljs-syntax-wptree,
* cpt.Ljs-syntax-tree,
Description::
In order to create an-algorithm in any format, we must use other entities[1], that[1] REPRESENT NOTHING in archetype and which[1] are INDIVISIBLE.
These are the-units of the-algorithm, and the entire algorithm is a whole-part-tree system of constructs of these units.
Natural-languages use sounds or symbols.
Flowcharts use graphs.
Code uses computer-symbols, the-unicode-characters, groups of bits in binary-code.
Ljb and Ljn use the same code-units.
Name::
* cpt.Ljs-algo--unit,
* cpt.Ljs-unit,
* cpt.Ljs-unit,
Description::
Code-units are the-units of code.
Ljs-code is case-sensitive and its units are the-Unicode character-set.
Name::
* cpt.Ljs-code-unit,
* cpt.Ljs-unit.code,
* cpt.Ljs-code-unit,
Description::
Words are combinations of units, that REPRESENT NOTHING, the-language uses to create whole constructs with meaning (= denote archetype).
Name::
* cpt.Ljs-algo--word,
* cpt.Ljs-word,
* cpt.Ljs-word,
Description::
An-algorithm is a-document with a-whole-part-tree-structure created by combining simpler parts.
The-units (indivisible parts) that DENOTE ARCHETYPE, used to create an-algorithm, are the-semantic-units.
Programing-languages use different semantic-units and combinations of semantic-units to create algorithms that map the same archetype.
Name::
* cpt.Data-type-ljs,
* cpt.Data-structure-ljs,
* cpt.Ljs-data-type,
* cpt.Ljs-data-structure,
* cpt.Ljs-semantic-unit,
* cpt.Ljs-semantic-unit,
* cpt.Ljs-sut,
* cpt.Ljs-sunit,
* cpt.Ljs-untSmc,
* cpt.Ljs-unit.semantic,
* cpt.Semantic-unit-of-javascript,
Whole-chain::
=== (syntax-wptree)
* Ljs-phrase,
* Ljs-sentence,
* Ljs-section,
* Ljs-library,
* Ljs-program,
=== (API-wptree)
* another semantic-unit,
...
* most-whole-object,
Generic-chain::
* object,
or
* objectNo,
Part::
* Ljs-word,
* Ljs-unit,
Description::
Most semantic-units are anonymous.
Only a-function has name in one case.
The-code below, shows how we give names to semantic-units.
The-name we give to a-semantic-unit when we create a-variable, I call REFERENCE-NAME.
A-semantic-unit can have many reference-names.
The other name that a-semantic-unit can-have (as a-member of it) I call INTERNAL-NAME.
Code.ljs::
> function f(){} //function with internal-name
> var f = function(){} //anonymous function, with reference-name
> var f = function f2(){} //function with internal and reference name
> [1,2] //anonymous array, lost in global
> var a = [1,2] //anonymous array, with reference-name
> a.name = 'sgm' //array with internal and reference name
> b = a //another reference-name for sgm-array
> c = b //another reference-name for sgm-array
> c.name //gives 'sgm'
Name::
* cpt.Internal-name-of-semantic-unit-of-javascript,
* cpt.Ljs-internal-name-of-semantic-unit,
* cpt.Ljs-name-of-semantic-unit,
* cpt.Ljs-reference-name-of-semantic-unit,
* cpt.Ljs-semantic-unit'internal-name,
* cpt.Ljs-semantic-unit'name,
* cpt.Ljs-semantic-unit'reference-name,
* cpt.Name-of-semantic-unit-of-javascript,
* cpt.Reference-name-of-semantic-unit-of-javascript,
Specific::
Ljs uses only 11 semantic-units to create algorithms:
01) a - Array,
02) b - Boolean,
03) f - Function,
04) l - nuLl,
05) m - Module,
06) n - Number,
07) o - Object,
08) r - Regexp,
09) s - String,
10) u - Undefined,
11) x - miXed,
Specific.alphabetically::
* array--semantic-unit,
* boolean--semantic-unit,
* custom--semantic-unit,
* customNo--semantic-unit,
* function--semantic-unit,
* Ljb-semantic-unit,
* Ljn-semantic-unit,
* name-semantic-unit,
* nameNo-semantic-unit,
* name-value-pair-mixed--semantic-unit,
* name-value-pair-mixedNo--semantic-unit,
* name-value-pair-No--semantic-unit,
* null--semantic-unit,
* number--semantic-unit,
* object--semantic-unit,
* objectNo--semantic-unit,
* regexp--semantic-unit,
* string--semantic-unit,
* undefined--semantic-unit,
Description::
Code-semantic-unit is a-semantic-unit written in code-format.
Name::
* cpt.Ljs-semantic-unit.code,
* cpt.Ljs-semantic-unit.code,
* cpt.Ljs-code-semantic-unit,
Specific::
* Ljb-semantic-unit,
* Ljn-semantic-unit,
Specific::
* object-semantic-unit,
* objectNo-semantic-unit,
Description::
ObjectNo is a-semantic-unit which is NOT object, it is NOT specific of Object.prototype.
Only 2 semantic-units are not objects: null
, undefined
.
Specific::
* Name-semantic-unit,
* NameNo-semantic-unit,
Description::
Name-semantic-unit is a-semantic-unit which HAS a-name associated with it, internal or reference or both.
Name::
* cpt.Ljs-anonymousNo-semantic-unit,
* cpt.Ljs-named-semantic-unit,
* cpt.Ljs-anonymousNo-semantic-unit,
* cpt.Ljs-named-semantic-unit,
* cpt.Ljs-name-semantic-unit,
Description::
NameNo is a-semantic-unit which HAS NO a-name associated with it.
Name::
* cpt.Ljs-anonymous-semantic-unit,
* cpt.Ljs-anonymous-semantic-unit,
* cpt.Ljs-nameNo-semantic-unit,
* cpt.Ljs-name-value-pair-No-semantic-unit,
* cpt.Ljs-nameNo,
* cpt.Ljs-nameNo,
Specific::
* custom-semantic-unit,
* customNo-semantic-unit,
Description::
A-semantic-unit created by a-programer.
Name::
* cpt.Ljs-builtinNo-semantic-unit,
* cpt.Ljs-builtinNo-semantic-unit,
* cpt.Ljs-custom-semantic-unit,
* cpt.Ljs-custom-semantic-unit,
* cpt.Ljs-nativeNo-semantic-unit,
* cpt.Ljs-nativeNo-semantic-unit,
* cpt.Ljs-standardNo-semantic-unit,
* cpt.Ljs-standardNo-semantic-unit,
Description::
A-semantic-unit created by a-programer in a specific program|library.
Name::
* cpt.Ljs-customInternal-semantic-unit,
* cpt.Ljs-customOwn-semantic-unit,
* cpt.Ljs-dependencyNo-semantic-unit,
* cpt.Ljs-dependentNo-semantic-unit,
* cpt.Ljs-independent-semantic-unit,
* cpt.Ljs-ownCustom-semantic-unit,
* cpt.Ljs-customInternal-semantic-unit,
* cpt.Ljs-customOwn-semantic-unit,
* cpt.Ljs-dependencyNo-semantic-unit,
* cpt.Ljs-dependentNo-semantic-unit,
* cpt.Ljs-independent-semantic-unit,
Description::
A-semantic-unit created by a-programer in ANOTHER program|library.
Name::
* cpt.Ljs-customExternal-semantic-unit,
* cpt.Ljs-customOwnNo-semantic-unit,
* cpt.Ljs-dependency-semantic-unit,
* cpt.Ljs-dependent-semantic-unit,
* cpt.Ljs-independentNo-semantic-unit,
* cpt.Ljs-ownNoCustom-semantic-unit,
* cpt.Ljs-customExternal-semantic-unit,
* cpt.Ljs-customOwnNo-semantic-unit,
* cpt.Ljs-dependency-semantic-unit,
* cpt.Ljs-dependent-semantic-unit,
* cpt.Ljs-independentNo-semantic-unit,
* cpt.Ljs-ownNoCuston-semantic-unit,
Description::
A-semantic-unit created by the-language-creator.
Name::
* cpt.Ljs-builtin-semantic-unit,
* cpt.Ljs-built-in-semantic-unit,
* cpt.Ljs-customNo-semantic-unit,
* cpt.Ljs-native-semantic-unit,
* cpt.Ljs-standard-semantic-unit,
* cpt.Ljs-builtin-semantic-unit,
* cpt.Ljs-built-in-semantic-unit,
* cpt.Ljs-customNo-semantic-unit,
* cpt.Ljs-native-semantic-unit,
* cpt.Ljs-standard-semantic-unit,
Description::
A-semantic-unit created inside a-program|library.
Name::
* cpt.Ljs-exteranlNo-semantic-unit,
* cpt.Ljs-internal-semantic-unit,
* cpt.Ljs-own-semantic-unit,
* cpt.Ljs-exteranlNo-semantic-unit,
* cpt.Ljs-internal-semantic-unit,
* cpt.Ljs-own-semantic-unit,
Description::
A-semantic-unit created OUTSIDE of a-program|library, native or custom.
Name::
* cpt.Ljs-exteranl-semantic-unit,
* cpt.Ljs-internalNo-semantic-unit,
* cpt.Ljs-ownNo-semantic-unit,
* cpt.Ljs-exteranl-semantic-unit,
* cpt.Ljs-internalNo-semantic-unit,
* cpt.Ljs-ownNo-semantic-unit,
Description::
Array is an-ordered-collection of other semantic-units.
Code-example:
var a = [true, 1, {n:1}, /d/, 's'];
Name::
* cpt.Ljs-array,
* cpt.Ljs-a-(Javascript-array),
* cpt.Ljsa-(Javascript-array),
Generic-chain::
* Array.prototype, ([].__proto__ === Array.prototype //true
)
* Object.prototype, ([].__proto__.__proto__ === Object.prototype //true
)
Description::
Code:
var a1 = [1, 's'];
//===
var a2 = new Array(1, 's');
Description::
Elements|items are the-entities an-array contains.
To access them Ljs uses the-code:
a[nIndex]
Name::
* cpt.Ljs-array-element,
* cpt.Ljs-array-item,
* cpt.Ljs-a-element,
* cpt.Ljs-a-item,
Description::
Index-of-array is a-number (starts with 0) that denotes the-order of one of its elements.
Description::
Arrays are-considered objects of the-Array-constructor-function, with generic the-Array.prototype-object.
In other words, the-members-of-the-Array.prototype-object are-inherited by all arrays.
Also, any array[1] can-have extra members in addition to its[1] inherited members and to its[1] elements.
Code:
a.n = 3;
Description::
Array
is a-built-in-function and is-considered the-constructor, of all arrays.
Then, Array.prototype is the-parent-generic-object of all arrays.
Name::
* cpt.Ljs-Array-constructor,
* cpt.Ljs-Array-function,
* cpt.Ljs-f.Array,
Generic-chain::
* Function.prototype (Array.__proto__ === Function.prototype //true
),
* Object.prototype (Array.__proto__.__proto__ === Object.prototype //true
),
Description::
Array.prototype
[1] is the-generic-object, of all arrays.
In other words, its[1] members are-inherited by all arrays.
Name::
* cpt.Ljs-Array.prototype-object,
* cpt.Ljs-o.Array.prototype,
Generic-chain::
* Object.prototype (Array.prototype.__proto__ === Object.prototype //true
),
Member:
Code
(ljn.622):
> Object.getOwnPropertyNames(Array.prototype).sort()
[ 'concat', 'constructor', 'copyWithin', 'entries', 'every', 'fill', 'filter', 'find', 'findIndex', 'forEach', 'includes', 'indexOf', 'join', 'keys', 'lastIndexOf', 'length', 'map', 'pop', 'push', 'reduce', 'reduceRight', 'reverse', 'shift', 'slice', 'some', 'sort', 'splice', 'toLocaleString', 'toString', 'unshift' ]
(Chrome.50):
> Object.getOwnPropertyNames(Array.prototype).sort()
["concat", "constructor", "copyWithin", "entries", "every", "fill", "filter", "find", "findIndex", "forEach", "includes", "indexOf", "join", "keys", "lastIndexOf", "length", "map", "pop", "push", "reduce", "reduceRight", "reverse", "shift", "slice", "some", "sort", "splice", "toLocaleString", "toString", "unshift"]
(Firefox.45):
> Object.getOwnPropertyNames(Array.prototype).sort()
["concat", "constructor", "copyWithin", "entries", "every", "fill", "filter", "find", "findIndex", "forEach", "includes", "indexOf", "join", "keys", "lastIndexOf", "length", "map", "pop", "push", "reduce", "reduceRight", "reverse", "shift", "slice", "some", "sort", "splice", "toLocaleString", "toSource", "toString", "unshift"]
(Edge.20):
> Object.getOwnPropertyNames(Array.prototype).sort()
["concat", "constructor", "copyWithin", "entries", "every", "fill", "filter", "find", "findIndex", "forEach", "indexOf", "join", "keys", "lastIndexOf", "length", "map", "pop", "push", "reduce", "reduceRight", "reverse", "shift", "slice", "some", "sort", "splice", "toLocaleString", "toString", "unshift", "values"]
(Safari.5-1-7):
> Object.getOwnPropertyNames(Array.prototype).sort()
["concat", "constructor", "every", "filter", "forEach", "indexOf", "join", "lastIndexOf", "length", "map", "pop", "push", "reduce", "reduceRight", "reverse", "shift", "slice", "some", "sort", "splice", "toLocaleString", "toString", "unshift"]
Description::
The concat() method is used to merge two or more arrays. This method does not change the existing arrays, but instead returns a new array.
var arr1 = ["a", "b", "c"];
var arr2 = ["d", "e", "f"];
var arr3 = arr1.concat(arr2);
// results in a new array [ "a", "b", "c", "d", "e", "f" ]
[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat]
Name::
* cpt.Ljs-a-concat-function,
* cpt.Ljs-a-mbr.concat-function,
* cpt.Ljs-concat-array-function,
Description::
The copyWithin() method shallow copies part of an array to another location in the same array and returns it, without modifying its size.
["alpha", "bravo", "charlie", "delta"].copyWithin(2, 0);
// results in ["alpha", "bravo", "alpha", "bravo"]
[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin]
===
["alpha", "bravo", "charlie", "delta"].copyWithin(1);
// results in ["alpha", "alpha", "bravo", "charlie"]
Name::
* cpt.Ljs-a-copyWithin-function,
* cpt.Ljs-a-mbr.copyWithin-function,
* cpt.Ljs-copyWithin-array-function,
Description::
The entries() method returns a new Array Iterator object that contains the key/value pairs for each index in the array.
var a = ['a', 'b', 'c'];
var iterator = a.entries();
console.log(iterator.next().value); // [0, 'a']
console.log(iterator.next().value); // [1, 'b']
console.log(iterator.next().value); // [2, 'c']
[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/entries]
Name::
* cpt.Ljs-a-entries-function,
* cpt.Ljs-a-mbr.entries-function,
* cpt.Ljs-entries-array-function,
Description::
The every() method tests whether all elements in the array pass the test implemented by the provided function.
function isBigEnough(element, index, array) {
return element >= 10;
}
[12, 5, 8, 130, 44].every(isBigEnough); // false
[12, 54, 18, 130, 44].every(isBigEnough); // true
[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every]
Name::
* cpt.Ljs-a-every-function,
* cpt.Ljs-a-mbr.every-function,
* cpt.Ljs-every-array-function,
Description::
The fill() method fills all the elements of an array from a start index to an end index with a static value.
var numbers = [1, 2, 3]
numbers.fill(1);
// results in [1, 1, 1]
[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill]
Name::
* cpt.Ljs-a-fill-function,
* cpt.Ljs-a-mbr.fill-function,
* cpt.Ljs-fill-array-function,
Description::
The filter() method creates a new array with all elements that pass the test implemented by the provided function.
[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter]
===
> ['a', false, 'b', undefined, 'c', null, NaN, 3].filter(Number)
< [3]
===
> Object.getOwnPropertyNames(Math).sort().filter(function(sM){return sM.match(/^[s-z]/)})
< [ 'sign', 'sin', 'sinh', 'sqrt', 'tan', 'tanh', 'trunc' ]
Name::
* cpt.Ljs-a-filter-function,
* cpt.Ljs-a-mbr.filter-function,
* cpt.Ljs-filter-array-function,
Description::
The find() method returns a value of the first element in the array that satisfies the provided testing function. Otherwise undefined is returned.
function isBigEnough(element) {
return element >= 15;
}
[12, 5, 8, 130, 44].find(isBigEnough); // 130
[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find]
Name::
* cpt.Ljs-a-find-function,
* cpt.Ljs-a-mbr.find-function,
* cpt.Ljs-find-array-function,
Description::
The findIndex() method returns an index of the first element in the array that satisfies the provided testing function. Otherwise -1 is returned.
function isBigEnough(element) {
return element >= 15;
}
[12, 5, 8, 130, 44].findIndex(isBigEnough); // 3
[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex]
Name::
* cpt.Ljs-a-findIndex-function,
* cpt.Ljs-a-mbr.findIndex-function,
* cpt.Ljs-findIndex-array-function,
Description::
The forEach() method executes a provided function once for each array element.
var a = ["a", "b", "c"];
a.forEach(function(element) {
console.log(element);
});
// a
// b
// c
[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach]
Name::
* cpt.Ljs-a-forEach-function,
* cpt.Ljs-a-mbr.forEach-function,
* cpt.Ljs-forEach-array-function,
Description::
The includes() method determines whether an array includes a certain element, returning true or false as appropriate.
var a = [1, 2, 3];
a.includes(2); // true
a.includes(4); // false
[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes]
Name::
* cpt.Ljs-a-includes-function,
* cpt.Ljs-a-mbr.includes-function,
* cpt.Ljs-includes-array-function,
Description::
The indexOf() method returns the first index at which a given element can be found in the array, or -1 if it is not present.
var a = [2, 9, 9];
a.indexOf(2); // 0
a.indexOf(7); // -1
if (a.indexOf(7) === -1) {
// element doesn't exist in array
}
[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf]
===
> [1,2,3].indexOf(3)
2
> [1,2,3].indexOf(4)
-1
> [1,2,3].indexOf(0)
-1
Name::
* cpt.Ljs-a-indexOf-function,
* cpt.Ljs-a-mbr.indexOf-function,
* cpt.Ljs-indexOf-array-function,
Description::
The join() method joins all elements of an array into a string.
var a = ['Wind', 'Rain', 'Fire'];
a.join(); // 'Wind,Rain,Fire'
a.join('-'); // 'Wind-Rain-Fire'
[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join]
===
> [1,2,3].join()
"1,2,3"
> [1,2,3].join(' ')
"1 2 3"
> [1,2,3].join(' and ')
"1 and 2 and 3"
Name::
* cpt.Ljs-a-join-function,
* cpt.Ljs-a-mbr.join-function,
* cpt.Ljs-join-array-function,
Description::
The keys() method returns a new Array Iterator that contains the keys for each index in the array.
var arr = ["a", "b", "c"];
var iterator = arr.keys();
console.log(iterator.next()); // { value: 0, done: false }
console.log(iterator.next()); // { value: 1, done: false }
console.log(iterator.next()); // { value: 2, done: false }
console.log(iterator.next()); // { value: undefined, done: true }
[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/keys]
Name::
* cpt.Ljs-a-keys-function,
* cpt.Ljs-a-mbr.keys-function,
* cpt.Ljs-keys-array-function,
Description::
The lastIndexOf() method returns the last index at which a given element can be found in the array, or -1 if it is not present. The array is searched backwards, starting at fromIndex.
var numbers = [2, 5, 9, 2];
numbers.lastIndexOf(2); // 3
numbers.lastIndexOf(7); // -1
[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf]
Name::
* cpt.Ljs-a-lastIndexOf-function,
* cpt.Ljs-a-mbr.lastIndexOf-function,
* cpt.Ljs-lastIndexOf-array-function,
Description::
> ['a', 'b', 'c'].length
3
===
The maximum length until "it gets sluggish" is totally dependent on your target machine and your actual code, so you'll need to test on that (those) platform(s) to see what is acceptable.
However, the maximum length of an array according to the ECMA-262 5th Edition specification is bound by an unsigned 32-bit integer due to the ToUint32 abstract operation, so the longest possible array could have 232-1 = 4,294,967,295 = 4.29 billion elements.
[http://stackoverflow.com/a/6155063]
Name::
* cpt.Ljs-a-length-number,
* cpt.Ljs-a-mbr.length-number,
* cpt.Ljs-length-array-number-member,
Description::
The map() method creates a new array with the results of calling a provided function on every element in this array.
var numbers = [1, 5, 10, 15];
var roots = numbers.map(function(x){
return x * 2;
});
// roots is now [2, 10, 20, 30]
// numbers is still [1, 5, 10, 15]
[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map]
Name::
* cpt.Ljs-a-map-function,
* cpt.Ljs-a-mbr.map-function,
* cpt.Ljs-map-array-function,
Description::
The pop() method removes the last element from an array and returns that element. This method changes the length of the array.
var a = [1, 2, 3];
a.pop();
console.log(a); // [1, 2]
[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/pop]
Name::
* cpt.Ljs-a-pop-function,
* cpt.Ljs-a-mbr.pop-function,
* cpt.Ljs-pop-array-function,
Description::
The push() method adds one or more elements to the end of an array and returns the new length of the array.
var numbers = [1, 2, 3];
numbers.push(4);
console.log(numbers); // [1, 2, 3, 4]
numbers.push(5, 6, 7);
console.log(numbers); // [1, 2, 3, 4, 5, 6, 7]
[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push]
Name::
* cpt.Ljs-a-push-function,
* cpt.Ljs-a-mbr.push-function,
* cpt.Ljs-push-array-function,
Description::
The reduce() method applies a function against an accumulator and each value of the array (from left-to-right) to reduce it to a single value.
var sum = [0, 1, 2, 3].reduce(function(a, b) {
return a + b;
}, 0);
// sum is 6
var flattened = [[0, 1], [2, 3], [4, 5]].reduce(function(a, b) {
return a.concat(b);
}, []);
// flattened is [0, 1, 2, 3, 4, 5]
[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce]
Name::
* cpt.Ljs-a-reduce-function,
* cpt.Ljs-a-mbr.reduce-function,
* cpt.Ljs-reduce-array-function,
Description::
The reduceRight() method applies a function against an accumulator and each value of the array (from right-to-left) has to reduce it to a single value.
var flattened = [[0, 1], [2, 3], [4, 5]].reduceRight(function(a, b) {
return a.concat(b);
}, []);
// flattened is [4, 5, 2, 3, 0, 1]
[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/ReduceRight]
Name::
* cpt.Ljs-a-reduceRight-function,
* cpt.Ljs-a-mbr.reduceRight-function,
* cpt.Ljs-reduceRight-array-function,
Description::
The reverse() method reverses an array in place. The first array element becomes the last, and the last array element becomes the first.
var a = ['one', 'two', 'three'];
a.reverse();
console.log(a); // ['three', 'two', 'one']
[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse]
Name::
* cpt.Ljs-a-reverse-function,
* cpt.Ljs-a-mbr.reverse-function,
* cpt.Ljs-reverse-array-function,
Description::
The shift() method removes the first element from an array and returns that element. This method changes the length of the array.
var a = [1, 2, 3];
a.shift();
console.log(a); // [2, 3]
[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift]
Name::
* cpt.Ljs-a-shift-function,
* cpt.Ljs-a-mbr.shift-function,
* cpt.Ljs-shift-array-function,
Description::
The slice() method returns a shallow copy of a portion of an array into a new array object selected from begin to end (end not included). The original array will not be modified.
var a = ["zero", "one", "two", "three"];
var sliced = a.slice(1,3);
console.log(a); // [ "zero", "one", "two", "three" ]
console.log(sliced); // [ "one", "two" ]
[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice]
===
//create arrays from array-like
> Array.prototype.slice.call({0:'a',1:'b',2:'c',length:3})
["a", "b", "c"]
> Array.prototype.slice.call({0:'a',1:'b',2:'c'})
[]
Name::
* cpt.Ljs-a-slice-function,
* cpt.Ljs-a-mbr.slice-function,
* cpt.Ljs-slice-array-function,
Description::
The some() method tests whether some element in the array passes the test implemented by the provided function.
function isBiggerThan10(element, index, array) {
return element > 10;
}
[2, 5, 8, 1, 4].some(isBiggerThan10); // false
[12, 5, 8, 1, 4].some(isBiggerThan10); // true
[https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/some]
Name::
* cpt.Ljs-a-some-function,
* cpt.Ljs-a-mbr.some-function,
* cpt.Ljs-some-array-function,
Description::
The sort() method sorts the elements of an array in place and returns the array. The sort is not necessarily stable. The default sort order is according to string Unicode code points.
var fruit = ['cherries', 'apples', 'bananas'];
fruit.sort(); // ['apples', 'bananas', 'cherries']
var scores = [1, 10, 21, 2];
scores.sort(); // [1, 10, 2, 21]
// Watch out that 10 comes before 2,
// because '10' comes before '2' in Unicode code point order.
var things = ['word', 'Word', '1 Word', '2 Words'];
things.sort(); // ['1 Word', '2 Words', 'Word', 'word']
// In Unicode, numbers come before upper case letters,
// which come before lower case letters.
[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort]
Name::
* cpt.Ljs-a-sort-function,
* cpt.Ljs-a-mbr.sort-function,
* cpt.Ljs-sort-array-function,
Description::
The splice() method changes the content of an array by removing existing elements and/or adding new elements.
var myFish = ["angel", "clown", "mandarin", "surgeon"];
myFish.splice(2, 0, "drum");
// myFish is ["angel", "clown", "drum", "mandarin", "surgeon"]
[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice]
Name::
* cpt.Ljs-a-mbr.splice-function,
* cpt.Ljs-splice-array-function,
Description::
The toLocaleString() method returns a string representing the elements of the array. The elements are converted to Strings using their toLocaleString methods and these Strings are separated by a locale-specific String (such as a comma “,”).
var number = 1337;
var date = new Date();
var myArr = [number, date, 'foo'];
var str = myArr.toLocaleString();
console.log(str);
// logs '1337,6.12.2013 19:37:35,foo'
// if run in a German (de-DE) locale with timezone Europe/Berlin
[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toLocaleString]
Name::
* cpt.Ljs-a-toLocaleString-function,
* cpt.Ljs-a-mbr.toLocaleString-function,
* cpt.Ljs-toLocaleString-array-function,
Description::
The toString() method returns a string representing the specified array and its elements.
var months = ["Jan", "Feb", "Mar", "Apr"];
months.toString(); // "Jan,Feb,Mar,Apr"
[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString]
Name::
* cpt.Ljs-a-toString-function,
* cpt.Ljs-a-mbr.toString-function,
* cpt.Ljs-toString-array-function,
Description::
The unshift() method adds one or more elements to the beginning of an array and returns the new length of the array.
var a = [1, 2, 3];
a.unshift(4, 5);
console.log(a); // [4, 5, 1, 2, 3]
[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift]
Name::
* cpt.Ljs-a-unshift,
* cpt.Ljs-a-mbr.unshift-function,
* cpt.Ljs-unshift-array-function,
Description::
The values() method returns a new Array Iterator object that contains the values for each index in the array.
var a = ['w', 'y', 'k', 'o', 'p'];
var iterator = a.values();
console.log(iterator.next().value); // w
console.log(iterator.next().value); // y
console.log(iterator.next().value); // k
console.log(iterator.next().value); // o
console.log(iterator.next().value); // p
[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/values]
Name::
* cpt.Ljs-a-values-function,
* cpt.Ljs-a-mbr.values-function,
* cpt.Ljs-values-array-function,
Description::
Boolean is any of the two semantic-units: false, true.
Name::
* cpt.Ljs-boolean,
* cpt.Ljs-b,
* cpt.Ljs-boolean,
Generic-chain::
* Boolean.prototype, (true.__proto__ === Boolean.prototype //true
)
* Object.prototype, (true.__proto__.__proto__ === Object.prototype //true
)
Description::
Boolean.prototype
is the-generic-object, of booleans.
In other words, its members are-inherited by booleans.
Name::
* cpt.Ljs-o.Boolean.prototype,
* cpt.Ljs-Boolean.prototype-object,
Generic-chain::
* Object.prototype (Boolean.prototype.__proto__ === Object.prototype //true
),
Member:
(ljn.630):
> Object.getOwnPropertyNames(Boolean.prototype).sort()
[ 'constructor', 'toString', 'valueOf' ]
(Chrome.50):
> Object.getOwnPropertyNames(Boolean.prototype).sort()
["constructor", "toString", "valueOf"]
(Firefox.46):
> Object.getOwnPropertyNames(Boolean.prototype).sort()
["constructor", "toSource", "toString", "valueOf"]
(Edge.20):
> Object.getOwnPropertyNames(Boolean.prototype).sort()
["constructor", "toString", "valueOf"]
(Safari.5-1-7):
> Object.getOwnPropertyNames(Boolean.prototype).sort()
["constructor", "toString", "valueOf"]
Description::
Function is the-semantic-unit that PROCESSES information.
Optionally has input and output.
Name::
* cpt.Ljs-function,
* cpt.Ljsf-(Javascript-function),
Whole-chain::
* the-semantic-unit in which defined,
...
* most-whole-object,
Generic-chain::
* Function.prototype, (var f = function(){}; f.__proto__ === Function.prototype //true
)
* Object.prototype, (f.__proto__.__proto__ === Object.prototype //true
)
Description::
With a-compound-sentence, we define|create a-function.
We define its input, output and what info-processing will-do.
Code:
function fName() { // inside parentheses we write the input identifiers
//what to do
//last, what to return
}
or
var fName = function() {
//what to do
//last, what to return
}
In the second case, we define one name-value-pair with name fName
and value an anonymous function.
Name::
* cpt.Ljs-function-creation,
* cpt.Ljs-function-definition,
* cpt.Ljs-f-creation,
* cpt.Ljs-f-definition,
Description::
Function-call is the-process of setting a-function to work.
We define a-function once, we call it as many times as we wish.
We use the next phrase, to call a-function.
Code:
fName()
Inside the-parentheses we put the-values of the-identifiers used in the-definition.
Name::
* cpt.Ljs-function-call,
* cpt.Ljs-function-execution,
* cpt.Ljs-function-invocation,
* cpt.Ljs-f-call,
* cpt.Ljs-f-execution,
* cpt.Ljs-f-invocation,
Description::
Function's-input is optional information (semantic-units) we give to a-function to do its work.
Name::
* cpt.Ljs-function-input,
* cpt.Ljs-function's-input,
* cpt.Ljs-f-input,
Function's-parameter:
In a-function's-definition, as input information we do-not-give values, we give identifiers of name-value-pairs.
These input identifiers are-called PARAMETERS.
I use the-notation: xNameIn
where 'x' denotes what semantic-unit is.
Function's-argument:
When we call a-function, as input information we give values, not identifiers.
These input values are-called ARGUMENTS.
Description::
Function's-output is optional information (semantic-unit) we could-RECEIVE from a-function.
If a-function has no output, then the-output is-considered the-undefined-semantic-unit.
Name::
* cpt.Ljs-function-output,
* cpt.Ljs-function's-output,
* cpt.Ljs-f-output,
Return-sentence:
The last sentence in the-definition-of-a-function is the-return-sentence, the-sentence that denotes what the-function will return.
Code: return o;
Name::
* cpt.Ljs-return-sentence,
* cpt.Ljs-return-sentence,
* cpt.Ljs-return-statement,
* cpt.Ljs-return-statement,
* cpt.Ljs-sentence.return,
* cpt.Ljs-sentence.return,
Description::
The-name of a-function it's a little tricky business.
In this definition: function f(){}
, the-name is 'f': f.name //"f"
In this definition: var f = function(){}
, there is no name: f.name //""
In this definition: var f1 = function f2(){}
, the-name is 'f2': f1.name //"f2"; f2.name //error
In all other name-value-pairs we consider the-identifier as 'name'.
So when we need to create recursive-functions (= functions which call themselves), we use the first definition where the-name and the-reference to the-function are the-same.
Description::
This natural-language sentence is ambiguous.
First of all, the-verb 'is' has many meanings, eg 'has', 'is-specific-of', 'is-part-of' etc.
In javascript means that a-function is specific of the-object Object.prototype
, then and a-function is an-object.
Thus, a-function can-have members, like an-object.
A-function has the-members of its generics-chain.
BUT a-function has and other characteristics that an-object can-not have.
We can-call a-function, but not an-object.
Then, the correct sentence is: A-function is a specific of Object.prototype.
Description::
Function.prototype
[1] is the-generic-object, of all functions.
In other words, its[1] members are-inherited by all functions.
Usually, Constructor.prototype
is an-object.
But Function.prototype
is a-function: typeof Function.prototype //"function"
Name::
* cpt.Ljs-Function.prototype,
* cpt.Ljsf.Function.prototype,
* cpt.Ljs-Function.prototype-function,
Whole-chain::
* Function,
* most-whole-object,
Generic-chain::
* Object.prototype (Function.prototype.__proto__ === Object.prototype //true
),
Member:
Code (Chrome.50):
> Object.getOwnPropertyNames(Function.prototype).sort()
["apply", "arguments", "bind", "call", "caller", "constructor", "length", "name", "toString"]
(Firefox.46):
> Object.getOwnPropertyNames(Function.prototype).sort()
["apply", "arguments", "bind", "call", "caller", "constructor", "isGenerator", "length", "name", "toSource", "toString"]
(Edge.20):
> Object.getOwnPropertyNames(Function.prototype).sort()
["apply", "arguments", "bind", "call", "caller", "constructor", "length", "name", "toString"]
(Safari.5-1-7):
> Object.getOwnPropertyNames(Function.prototype).sort()
["apply", "bind", "call", "constructor", "length", "name", "toString"]
Specific::
* Function,
* Object,
* ...
* all builtin functions,
* all custom-functions,
Description::
Function
is the-constructor, of all functions:
> var f = function(){};
undefined
> f.constructor
function Function() { [native code] }
Name::
* cpt.Ljs-Function-constructor,
* cpt.Ljs-Function-function,
Whole-chain::
* most-whole-object,
Generic-chain::
* Function.prototype, (Function.__proto__ === Function.prototype //true
),
It is important to mention here that Function
CONTAINS its generic-object, the-Function.prototype.
* Object.prototype, (Function.__proto__.__proto__ === Object.prototype //true
)
Member:
Code (Chrome.50):
> Object.getOwnPropertyNames(Function).sort()
[]
(Firefox.46):
> Object.getOwnPropertyNames(Function).sort()
[]
(Edge.20):
> Object.getOwnPropertyNames(Function).sort()
[]
(Safari.5-1-7):
> Object.getOwnPropertyNames(Function).sort()
[]
Specific.alphabetically::
* constructor-function,
* custom-function,
* customNo-function,
* method-function,
* methodNo-function,
* named-function,
* namedNo-function,
* object-returning-function,
* operator-function,
* self-executing-function,
Description::
JavaScript classes introduced in ECMAScript 2015 are syntactical sugar over JavaScript's existing prototype-based inheritance. The class syntax is not introducing a new object-oriented inheritance model to JavaScript. JavaScript classes provide a much simpler and clearer syntax to create objects and deal with inheritance.
Defining classes
Classes are in fact "special functions", and just as you can define function expressions and function declarations, the class syntax has two components: class expressions and class declarations.
[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes]
Name::
* cpt.Ljs-class,
* cpt.Ljs-class,
* cpt.Ljs-class-function,
* cpt.Ljs-f.class,
===
I name a-class-function as: fNameCls.
AddressWpg::
* http://www.2ality.com/2015/02/es6-classes-final.html,
Evaluation:
My-evaluation: on-inheritance, on-todo.
Description::
Constructor is any function used to create objects using the-new keyword.
Code:
var oName = new fName();
Name::
* cpt.Constructor-function-of-javascript,
* cpt.Ljs-constructor,
* cpt.Ljs-constructor,
* cpt.Ljs-constructor-function,
* cpt.Ljs-f.constructor,
* cpt.Ljs-function.constructor,
===
Usually the-names of individual constructors begin with capital-letters.
===
I name a-constructor-function as: fNameCsr.
Constructor.prototype:
The-members of this special member of a-constructor, are-inherited by the-objects-created-by-a-constructor.
In other words, Constructor.prototype is the-generic-object of a-constructor's objects.
Description::
Method is a-function member of an-object.
Name::
* cpt.Ljs-function.method,
* cpt.Ljs-method,
* cpt.Ljs-f.method,
* cpt.Ljs-method,
Description::
Named-function is a-function which has name.
// defined as:
function f(){};
// or
var f1 = function f2(){};
Name::
* cpt.Ljs-named-function,
* cpt.Ljs-function.named,
* cpt.Ljs-f.named,
Description::
NamedNo-function is a-function which has NO name.
// defined as:
var f = function(){};
Name::
* cpt.Ljs-anonymous-function,
* cpt.Ljs-namedNo-function,
* cpt.Ljs-function.namedNo,
* cpt.Ljs-f.namedNo,
Description::
Objects have no scope.
To overcome this, we create objects by creating functions[1], which have scope, that[1] return the-object we want.
Code:
function f() {
var n = 1;
function f1(){var n2 = n;}
return {
f1: f1;
n: n;
};
}
Name::
* cpt.Ljs-factory-function,
* cpt.Ljs-function.object-returning,
* cpt.Ljs-object-factory-function,
* cpt.Ljs-object-returning-function,
* cpt.Ljs-f.factory,
* cpt.Ljs-f.object-factory,
* cpt.Ljs-f.object-returning,
AddressWpg::
* https://www.sitepoint.com/factory-functions-javascript/,
Description::
Operators are special functions with code similar to natural-languages and names special-symbols and special syntax.
Operators[1] are built-in, and a-programer calls them[1].
Name::
* cpt.Ljs-operator,
* cpt.Ljs-operator,
* cpt.Ljs-opr,
Operand:
Description::
Operands are the INPUT information of operators.
Name::
* cpt.Ljs-operand,
* cpt.Ljs-operand,
Specific.alphabetically::
* arithmetic-operator,
* assignment-operator,
* binary-operator,
* bitwise-operator,
* comma-operator,
* comparison-operator,
* conditional-operator,
* logical-operator,
* relational-operator,
* string-operator,
* ternary-operator,
* unary-operator,
Description::
Self-executing-function is a-function which defined and called at the same time.
Code:
(function() {
//what to do
//last, what to return
})();
Name::
* cpt.Ljs-function.self-executing,
* cpt.Ljs-self-executing-function,
* cpt.Ljs-f.self-executing,
* cpt.Ljs-self-executing-function,
Immediately-invoked-function-expression (IIFE):
It is the-sentence in the-code that defines and calls the-function.
Description::
Module is a-semantic-unit which
- can-be PART OF other modules and
- can-has AS PART other modules.
Like 'the-prototype-inheritance' mechanism which manages the GENERIC-SPECIFIC relations of the-semantic-units of an-API, modules is the-mechanism needed to manage the WHOLE-PART relations of the-semantic-units.
Today only Ljn supports modules.
Name::
* cpt.Ljs-module,
* cpt.Ljs-module,
* cpt.Ljs-m,
Generic-chain::
* semantic-unit,
Description::
Null is a special semantic-unit that denotes no-information, similar to zero quantity.
Name::
* cpt.Ljs-null,
* cpt.Ljs-null,
* cpt.Ljs-l,
Generic-chain::
* objectNo,
* semantic-unit,
===
'null
is not an object'.
In other words, null
is NOT SPECIFIC of an-ljs-object, it does not inherit the-members of an-object.
Code:
null
Description::
Number is a-semantic-unit that denotes numbers in archetype.
Name::
* cpt.Ljs-number,
* cpt.Ljs-n-(number),
Generic-chain::
* Number.prototype, ((3).__proto__ === Number.prototype //true
)
* Object.prototype, ((3).__proto__.__proto__ === Object.prototype //true
)
Description::
Number.prototype
is the-generic-object, of all numbers.
In other words, its members are-inherited by all numbers.
Name::
* cpt.Ljs-o.Number.prototype,
* cpt.Ljs-Number.prototype-object,
Generic-chain::
* Object.prototype (Number.prototype.__proto__ === Object.prototype //true
),
Member:
(Node.6.3.0):
> Object.getOwnPropertyNames(Number.prototype).sort()
[ 'constructor', 'toExponential', 'toFixed', 'toLocaleString', 'toPrecision', 'toString', 'valueOf' ]
(Chrome.50):
> Object.getOwnPropertyNames(Number.prototype).sort()
["constructor", "toExponential", "toFixed", "toLocaleString", "toPrecision", "toString", "valueOf"]
(Firefox.46):
> Object.getOwnPropertyNames(Number.prototype).sort()
["constructor", "toExponential", "toFixed", "toLocaleString", "toPrecision", "toSource", "toString", "valueOf"]
(Edge.20):
> Object.getOwnPropertyNames(Number.prototype).sort()
[constructor", "toExponential", "toFixed", "toLocaleString", "toPrecision", "toString", "valueOf"]
(Safari.5-1-7):
> Object.getOwnPropertyNames(Number.prototype).sort()
["constructor", "toExponential", "toFixed", "toLocaleString", "toPrecision", "toString", "valueOf"]
Description::
Object is a-collection of name-value-pairs, which inherits the-members of the-Object.prototype
, in other words it is SPECIFIC of the-Object.prototype
.
Objects are semantic-units that map concepts.
The famous sentence 'everything is an object', is wrong because there are and non-objects.
The correct sentence is: 'almost everything is an-Object.prototype'.
Name::
* cpt.Ljs-object,
* cpt.Ljs-o-(Javascript-object),
* cpt.Ljso-(Javascript-object),
Whole-chain::
=== (syntax-wptree)
* Ljs-phrase,
* Ljs-sentence,
* Ljs-library,
* Ljs-program,
=== (API-wptree)
* another semantic-unit,
...
* window,
Generic-chain::
A-generic-object inherits its members to its specifics.
===
* Object.prototype, (literal-objects ({}).__proto__ === Object.prototype //true
)
or
* Constructor.prototype, (constructor-objects)
or
* objectX, (var o = Object.create(objectX)
)
Description::
Members are-called the-name-value-pairs of an-object.
Name::
* cpt.Ljs-member-of-an-object,
* cpt.Ljs-object's-member,
* cpt.Ljs-object'member,
* cpt.Ljs-o-member,
* cpt.Ljso-member,
===
* Some (spec) call the-members-of-an-object 'properties', and some (MDN) with 'properties' call the-non-methods-members-of-an-object.
Same-name:
The-members of an-object can-NOT-have the-same name.
> var o = {a:1, a:2, a:3, A:4};
< Object {a: 3, A: 4}
Creating:
a) with the-creation of the-object.
b) after object creation with the-code:
object.member = value;
Access:
To access a-member of an-object, Ljs uses the-code:
// dot notation
object.member
// array notation
object["member"]
Array-notation gives us the-option to access a-member with variables:
var o = {sMbr:'a-string', nMbr:2};
var sM1 = 's' + 'Mbr';
console.log(o[sM1]) //returns 'a-string'
Specific::
* Custom: not a-unit native to language.
* CustomNo: a-unit native to language.
* Inherited: a-member of its generic-objects.
* InheritedNo,
* Method: a-member which is a-function.
* MethodNo: any other member. Some call them 'properties'.
* Internal: a-unit created inside current-algorithm.
* InternalNo: a-unit created in another algorithm and imported into current-algorithm.
* Public: a-member we have access from outside of the-object. ALL members of a-generic-object are public.
* PublicNo: A-function (a-specific-object) has publicNo members.
Specific.alphabetically::
* constructor-object,
* constructorNo-object,
* custom-object,
* customNo-object,
* first-class-object,
* first-class-no-object,
* literal-object,
* literalNo-object,
* most-generic-object,
* most-whole-object,
Description::
Constructor-object is an-object created with a-constructor-function: var o = new Constructor();
Name::
* cpt.Ljs-constructor-object,
* cpt.Ljs-object.constructor,
* cpt.Ljs-object-created-by-a-constructor,
* cpt.Ljs-constructor-object,
* cpt.Ljs-o.constructor,
===
I use to name individual constructor-objecs as: oConstructor
which helps reading the-code.
Generic-chain::
* Constructor.prototype,
...
* Object.prototype,
Member:
A-constructor-object[1] has as members the-members of its constructor that are-prefixed with this
.
Also it[1] INHERITS the-members of the-Constructor.prototype-object.
It is A-MISTAKE to call the-object-of-a-constructor, INSTANCE of the-constructor.
Description::
ConstructorNo-object is an-object NOT-CREATED with a-constructor-function: var o = new Constructor();
There are 3 cases:
a) a-literal-object.
b) var o = Object.create(o2);
Here, o2 is a-generic of o.
c) object created as a return of a-function.
Name::
* cpt.Ljs-constructorNo-object,
* cpt.Ljs-nonconstructor-object,
* cpt.Ljs-object.constructorNo,
* cpt.Ljs-object-not-created-by-a-constructor,
* cpt.Ljs-constructorNo-object,
* cpt.Ljs-nonconstructor-object,
* cpt.Ljs-o.constructorNo,
Description::
First-class-object is an-object which can-have members.
[https://developer.mozilla.org/en-US/docs/Web/javascript/Reference/Functions]
Name::
* cpt.Ljs-first-class-object,
* cpt.Ljs-firstclass-object,
* cpt.Ljs-object.first-class,
* cpt.Ljs-first-class-object,
* cpt.Ljs-firstclass-object,
* cpt.Ljs-o.first-class,
Specific::
* array,
* function,
* regexp,
* number-non-literal, (var n = new Number(2)
)
* string-non-literal, (var s = new String('string')
)
Description::
First-class-no- object is an-object which can-NOT-have members.
[https://developer.mozilla.org/en-US/docs/Web/javascript/Reference/Functions]
Name::
* cpt.Ljs-first-class-object.no,
* cpt.Ljs-first-class-object.no,
* cpt.Ljs-firstclass-object.no,
* cpt.Ljs-firstclass-object.no,
* cpt.Ljs-object.first-class.no,
* cpt.Ljs-object.first-class.no,
* cpt.Ljs-o.first-class.no,
Specific::
* boolean,
* number-literal, (var n = 2
)
* string-literal, (var s = 'string'
)
Description::
Literal-object is an-object created directly by the-programer.
Code:
var o = {
a: [1, 's'],
b: true,
f: function(){},
n: 2,
o2: {n:1, s:'s'},
r: /d/,
s: 'string',
}
Name::
* cpt.Ljs-literal-object,
* cpt.Ljs-object.literal,
* cpt.Ljs-literal-object,
* cpt.Ljs-o.literal,
Generic-chain::
* Object.prototype,
Description::
LiteralNo-object is an-object NOT created directly by the-programer.
Name::
* cpt.Ljs-literalNo-object,
* cpt.Ljs-non-literal-object,
* cpt.Ljs-object.literalNo,
* cpt.Ljs-literalNo-object,
* cpt.Ljs-non-literal-object,
* cpt.Ljs-o.literalNo,
Specific::
* constructor-object,
* var o = Object.create(o2);
* object created as a return of a-function.
Description::
RegExp (regular-expression) denotes parts of texts.
They are the-query-language for texts in archetype.
Code-example:
var r = /d/;
Name::
* cpt.Ljs-regexp,
* cpt.Ljs-r-(regular-expression),
* cpt.Ljs-regexp,
Generic-chain::
* RegExp.prototype, (/r/.__proto__ === RegExp.prototype //true
)
* Object.prototype, (/r/.__proto__.__proto__ === Object.prototype //true
)
Description::
RegExp.prototype
is the-generic-object, of all regexp.
In other words, its members are-inherited by all regexp.
Name::
* cpt.Ljs-o.RegExp.prototype,
* cpt.Ljs-RegExp.prototype,
* cpt.Ljs-RegExp.prototype-object,
Generic-chain::
* Object.prototype (RegExp.prototype.__proto__ === Object.prototype //true
),
Member:
(Chrome.50):
> Object.getOwnPropertyNames(RegExp.prototype).sort()
["compile", "constructor", "exec", "flags", "global", "ignoreCase", "multiline", "source", "sticky", "test", "toString", "unicode"]
(Firefox.46):
> Object.getOwnPropertyNames(RegExp.prototype).sort()
["compile", "constructor", "exec", "flags", "global", "ignoreCase", "lastIndex", "multiline", "source", "sticky", "test", "toSource", "toString", "unicode"]
(Edge.20):
> Object.getOwnPropertyNames(RegExp.prototype).sort()
["compile", "constructor", "exec", "global", "ignoreCase", "lastIndex", "multiline", "options", "source", "test", "toString", "unicode"]
(Safari.5-1-7):
> Object.getOwnPropertyNames(RegExp.prototype).sort()
["compile", "constructor", "exec", "global", "ignoreCase", "lastIndex", "multiline", "source", "test", "toString"]
Description::
Strings represent any text in archetype.
Strings have meaning for humans, but NOT for the-machines.
Code-example:
var s = 'string';
Name::
* cpt.Ljs-string,
* cpt.Ljs-s-(string),
Generic-chain::
* String.prototype, (''.__proto__ === String.prototype //true
)
* Object.prototype, (''.__proto__.__proto__ === Object.prototype //true
)
AddressWpg::
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/
Description::
String.prototype
is the-generic-object, of all strings.
In other words, its members are-inherited by all strings.
Name::
* cpt.Ljs-o.String.prototype,
* cpt.Ljs-String.prototype,
* cpt.Ljs-string.prototype-object,
Generic-chain::
* Object.prototype (String.prototype.__proto__ === Object.prototype //true
),
Member:
(Node.6.3.0):
> Object.getOwnPropertyNames(String.prototype).sort()
[ 'anchor', 'big', 'blink', 'bold', 'charAt', 'charCodeAt', 'codePointAt', 'concat', 'constructor', 'endsWith', 'fixed', 'fontcolor', 'fontsize', 'includes', 'indexOf', 'italics', 'lastIndexOf', 'length', 'link', 'localeCompare', 'match', 'normalize', 'repeat', 'replace', 'search', 'slice', 'small', 'split', 'startsWith', 'strike', 'sub', 'substr', 'substring', 'sup', 'toLocaleLowerCase', 'toLocaleUpperCase', 'toLowerCase', 'toString', 'toUpperCase', 'trim', 'trimLeft', 'trimRight', 'valueOf' ]
(Chrome.50):
> Object.getOwnPropertyNames(String.prototype).sort()
["anchor", "big", "blink", "bold", "charAt", "charCodeAt", "codePointAt", "concat", "constructor", "endsWith", "fixed", "fontcolor", "fontsize", "includes", "indexOf", "italics", "lastIndexOf", "length", "link", "localeCompare", "match", "normalize", "repeat", "replace", "search", "slice", "small", "split", "startsWith", "strike", "sub", "substr", "substring", "sup", "toLocaleLowerCase", "toLocaleUpperCase", "toLowerCase", "toString", "toUpperCase", "trim", "trimLeft", "trimRight", "valueOf"]
(Firefox.46):
> Object.getOwnPropertyNames(String.prototype).sort()
["anchor", "big", "blink", "bold", "charAt", "charCodeAt", "codePointAt", "concat", "constructor", "contains", "endsWith", "fixed", "fontcolor", "fontsize", "includes", "indexOf", "italics", "lastIndexOf", "length", "link", "localeCompare", "match", "normalize", "repeat", "replace", "search", "slice", "small", "split", "startsWith", "strike", "sub", "substr", "substring", "sup", "toLocaleLowerCase", "toLocaleUpperCase", "toLowerCase", "toSource", "toString", "toUpperCase", "trim", "trimLeft", "trimRight", "valueOf"]
(Edge.20):
> Object.getOwnPropertyNames(String.prototype).sort()
["anchor", "big", "blink", "bold", "charAt", "charCodeAt", "codePointAt", "concat", "constructor", "endsWith", "fixed", "fontcolor", "fontsize", "includes", "indexOf", "italics", "lastIndexOf", "length", "link", "localeCompare", "match", "normalize", "repeat", "replace", "search", "slice", "small", "split", "startsWith", "strike", "sub", "substr", "substring", "sup", "toLocaleLowerCase", "toLocaleUpperCase", "toLowerCase", "toString", "toUpperCase", "trim", "trimLeft", "trimRight", "valueOf"]
(Safari.5-1-7):
> Object.getOwnPropertyNames(String.prototype).sort()
["anchor", "big", "blink", "bold", "charAt", "charCodeAt", "concat", "constructor", "fixed", "fontcolor", "fontsize", "indexOf", "italics", "lastIndexOf", "length", "link", "localeCompare", "match", "replace", "search", "slice", "small", "split", "strike", "sub", "substr", "substring", "sup", "toLocaleLowerCase", "toLocaleUpperCase", "toLowerCase", "toString", "toUpperCase", "trim", "trimLeft", "trimRight", "valueOf"]
Description::
Undefined is a-semantic-unit that denotes a-name-value-pair without value assigned (initialized).
Also it is-used to denote that a-function has no output.
Code: undefined
Name::
* cpt.Ljs-undefined,
* cpt.Ljs-u,
* cpt.Ljs-undefined,
Generic-chain::
* objectNo,
* semantic-unit,
Description::
Mixed is a-name-value-pair that contains different semantic-units.
Name::
* cpt.Ljs-mixed,
* cpt.Ljs-mixed-semantic-unit,
* cpt.Ljs-mixed,
* cpt.Ljs-x,
Description::
API is a-set of semantic-units.
An-API, like any conceptual-information, is-structured at the SAME time, into 3 different tree-structures:
1) A-whole-part-tree with root-node the-most-whole-object and
2) A-generic-specific-tree with root-node the-most-generic-object (Object.prototype
).
3) A-directory-tree structure.
The-discovery (not invention) that an-API has and a-whole-part and a-generic-specific tree-structure, is mine which I first discovered to has any human-conceptual-information.
Name::
* cpt.API.ljs,
* cpt.Ljs-API,
* cpt.Ljs-Application-Programming-Interface,
* cpt.Ljs-Application-Programing-Interface,
* cpt.Ljs-aPI,
Description::
The whole-part relations of semantic-units form a whole-part-tree structure.
The-ROOT-node of this structure is the most-whole-object and contains all others.
It is called the-global-object.
With the same name are-called and its children (not its descendants).
In Ljb, this is the-window
-object.
In Ljn, this is the-global
-object.
Name::
* cpt.Ljs-most-whole-object,
* cpt.Ljs-global-object,
* cpt.Ljs-most-whole-object,
* cpt.Ljs-mwo,
* cpt.Most-whole-object,
Generic-chain::
...
* Object.prototype,
LOOK-THAT: the-most-whole-object is specific of the-most-generic-object.
Description::
The-members of the-most-whole-object are-called ALSO 'globals'.
To avoid ambiguity I will-call them 'global-members'.
Name::
* cpt.Ljs-global-member,
* cpt.Ljs-global,
* cpt.Ljs-globals,
* cpt.Ljs-member-of-most-whole-object,
* cpt.Ljs-global,
Specific::
* ljb-global-member,
* Ljn-global-member,
Description::
All Ljs-objects inherit the-members of this object.
Object.prototype is the-ROOT node of the-API-generic-specific-tree of ALL javascript dialects.
Name::
* cpt.Ljs-Object.prototype,
* cpt.Ljs-mgo-(most-generic-object),
* cpt.Ljs-most-generic-object,
* cpt.Ljs-object.prototype,
* cpt.Object.prototype,
Whole-chain::
* Object,
* most-whole-object,
LOOK-THAT: the-most-generic-object is part of the-Object-function, which is part of the-most-whole-object.
Member:
(ljn.6-3-1)
> Object.getOwnPropertyNames(Object.prototype).sort()
[ '__defineGetter__', '__defineSetter__', '__lookupGetter__', '__lookupSetter__', '__proto__', 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf' ]
(Chrome.50):
> Object.getOwnPropertyNames(Object.prototype).sort()
["__defineGetter__", "__defineSetter__", "__lookupGetter__", "__lookupSetter__", "__proto__", "constructor", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "toLocaleString", "toString", "valueOf"]
(Firefox.46):
> Object.getOwnPropertyNames(Object.prototype).sort()
["__defineGetter__", "__defineSetter__", "__lookupGetter__", "__lookupSetter__", "__proto__", "constructor", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "toLocaleString", "toSource", "toString", "unwatch", "valueOf", "watch"]
(Edge.20):
> Object.getOwnPropertyNames(Object.prototype).sort()
["__defineGetter__", "__defineSetter__", "__lookupGetter__", "__lookupSetter__", "__proto__", "constructor", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "toLocaleString", "toString", "valueOf"]
(Safari.5-1-7):
> Object.getOwnPropertyNames(Object.prototype).sort()
["__defineGetter__", "__defineSetter__", "__lookupGetter__", "__lookupSetter__", "constructor", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "toLocaleString", "toString", "valueOf"]
Specific::
* Ljb-Object.prototype,
* Ljn-ljsObject.prototype,
Description::
Object
is the-constructor that contains the-Object.prototype.
It can-create objects: var s = new Object('string');
It contains important names.
Name::
* cpt.Ljs-Object-function,
Whole-chain::
* most-whole-object,
Generic-chain::
* Function.prototype,
* Object.prototype,
Member:
(Chrome.50):
> Object.getOwnPropertyNames(Object).sort()
["arguments", "assign", "caller", "create", "defineProperties", "defineProperty", "freeze", "getOwnPropertyDescriptor", "getOwnPropertyNames", "getOwnPropertySymbols", "getPrototypeOf", "is", "isExtensible", "isFrozen", "isSealed", "keys", "length", "name", "preventExtensions", "prototype", "seal", "setPrototypeOf"]
(Firefox.46):
> Object.getOwnPropertyNames(Object).sort()
[]
(Edge.20):
> Object.getOwnPropertyNames(Object).sort()
[]
(Safari.5-1-7):
> Object.getOwnPropertyNames(Object).sort()
[]
Description::
The Object.create() method creates a new object with the specified prototype object and properties.
Syntax
Object.create(proto[, propertiesObject])
Parameters
proto
The object which should be the prototype of the newly-created object.
propertiesObject
Optional. If specified and not undefined, an object whose enumerable own properties (that is, those properties defined upon itself and not enumerable properties along its prototype chain) specify property descriptors to be added to the newly-created object, with the corresponding property names. These properties correspond to the second argument of Object.defineProperties().
Return value
A new object with the specified prototype object and properties.
Exceptions
A TypeError exception if the proto parameter isn't null or an object.
[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create]
Description::
The Object.getOwnPropertyNames() method returns an array of all properties (enumerable or not) found directly upon a given object.
Syntax
Object.getOwnPropertyNames(obj)
Parameters
obj
The object whose enumerable and non-enumerable own properties are to be returned.
Return value
An array of strings that correspond to the properties found directly upon the given object.
[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyNames]
Name::
* cpt.Ljs-Object.getOwnPropertyNames,
* cpt.Ljs-Object.getOwnPropertyNames-function,
* cpt.Ljs-Object.getOwnPropertyNames(),
Code:
> Object.getOwnPropertyNames(obj).sort() // to sort the-members.
> Object.getOwnPropertyNames(obj).join(', ') // to display ALL the-members.
> Object.getOwnPropertyNames(obj).filter(function(sM){return sM.match(/^[a-e]/)}) // to display the-members that begin with a-to-e.
Description::
The-semantic-units of an-api form a-whole-part-tree.
The-ROOT-node of this structure is the-most-whole-object (the-global-object) and contains all others.
Name::
* cpt.Ljs-API-whole-part-tree,
* cpt.Ljs-whole-part-tree-of-api,
* cpt.Ljs-wpt-API(Javascript-whole-part-tree-API),
Specific::
* Ljb-native-whole-part-tree,
* Ljn-native-whole-part-tree,
Description::
The-semantic-units of an-api except of a-whole-part-tree form AND a-generic-specific-tree.
The-ROOT-node of this structure is the-most-generic-object, the-Object.prototype
.
Name::
* cpt.Ljs-API-generic-specific-tree,
* cpt.Ljs-generic-specific-tree-of-API,
Specific::
* Ljb-native-generic-specific-tree,
* Ljn-native-generic-specific-tree,
Specific::
* ljb-API,
* ljn-API,
===
* native-API,
* nativeNo-API,
===
* vanilla-API,
* vanillaNo-API,
===
* library-API,
* program-API,
Descripton:
Vanilla-API is an-API with only native-semantic-units and custom-semantic-units created in one algorithm (no external libraries).
Name::
* cpt.Ljs-API.vanilla,
* cpt.Ljs-independent-API,
* cpt.Ljs-own-API,
* cpt.Ljs-plain-API,
* cpt.Ljs-vanilla-API,
Descripton:
VanillaNo-API is an-API which uses external libraries (has dependencies).
Name::
* cpt.Ljs-API.vanillaNo,
* cpt.Ljs-dependent-API,
* cpt.Ljs-ownNo-API,
* cpt.Ljs-vanillaNo-API,
Descripton:
Native-API is the-API with only and all the-native-semantic-units.
It has
- a-whole-part-tree-structure
- a-generic-specific-tree-structure and
- a-directory-tree-structure.
Name::
* cpt.Ljs-API.native,
* cpt.Ljs-native-API,
* cpt.Ljs-builtin-API,
Generic::
* Ljs-API,
Specific::
* Ljb-native-API,
* Ljn-native-API,
Description:
The Error constructor creates an error object. Instances of Error objects are thrown when runtime errors occur. The Error object can also be used as a base object for user-defined exceptions. See below for standard built-in error types.
Syntax
new Error([message[, fileName[, lineNumber]]])
[https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Error]
Name::
* cpt.Error-function-of-javascript,
* cpt.Ljs-Error-function,
Description::
All JavaScript and System errors raised by Node.js inherit from, or are instances of, the standard JavaScript Error
class and are guaranteed to provide at least the properties available on that class.
[https://nodejs.org/docs/v6.3.1/api/errors.html#errors_errors]
Member::
// ljn.6-3-1
// Object.getOwnPropertyNames(Error).sort()
[ 'arguments', 'caller', 'captureStackTrace', 'length', 'name', 'prototype', 'stackTraceLimit' ]
===
// Chrome.52
// Object.getOwnPropertyNames(Error).sort()
["arguments", "caller", "captureStackTrace", "length", "name", "prototype", "stackTraceLimit"]
===
// Firefox.47
// Object.getOwnPropertyNames(Error).sort()
[ "length", "name", "prototype" ]
===
// Edge.25
// Object.getOwnPropertyNames(Error).sort()
["arguments", "caller", length", "name", "prototype", "stackTraceLimit"]
Resource:
* https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Error,
* https://nodejs.org/api/errors.html,
Description::
The-javascript-JSON-object contains 2 functions that map javascript-semantic-units with JSON-language-semantic-units, eg {a:1, b:2} <==> {"a":1,"b":2}
Name::
* cpt.JSON-object-of-javascript,
* cpt.Ljs-JSON-object,
* cpt.Ljs-o.JSON,
Whole-chain::
* Ljs-most-whole-object (global),
LjsJSON'API:
(Chrome.55)
> Object.getOwnPropertyNames(JSON).sort().join(', ')
"parse, stringify"
> Object.getOwnPropertyNames(JSON.__proto__).sort().join(', ')
"__defineGetter__, __defineSetter__, __lookupGetter__, __lookupSetter__, __proto__, constructor, hasOwnProperty, isPrototypeOf, propertyIsEnumerable, toLocaleString, toString, valueOf"
Description::
The-JSON.parse()-function has as INPUT a-string that represents a-JSON-language-semantic-unit and OUTPUT the-javascript-semantic-unit that corresponds to that of JSON-language.
Code:
> var a = JSON.parse('[1,2]') //undefined
> a //[1, 2]
> var n = JSON.parse('2') //undefined
> n //2
> var o = JSON.parse('{"a":1,"b":2}') //undefined
> o //Object {a: 1, b: 2}
Description::
The-JSON.stringify()-function has as INPUT a-javascript-semantic-unit and OUTPUT a-string that corresponds to similar JSON-language-semantic-unit.
Name::
* cpt.Ljs-Math-object,
* cpt.Ljs-o.Math,
* cpt.Math-object-of-javascript,
Whole-chain::
* Ljs-most-whole-object (global),
LjsMath'Member::
(ljn.6-2-2)
> Object.getOwnPropertyNames(Math).sort()
[ 'E', 'LN10', 'LN2', 'LOG10E', 'LOG2E', 'PI', 'SQRT1_2', 'SQRT2', 'abs', 'acos', 'acosh', 'asin', 'asinh', 'atan', 'atan2', 'atanh', 'cbrt', 'ceil', 'clz32', 'cos', 'cosh', 'exp', 'expm1', 'floor', 'fround', 'hypot', 'imul', 'log', 'log10', 'log1p', 'log2', 'max', 'min', 'pow', 'random', 'round', 'sign', 'sin', 'sinh', 'sqrt', 'tan', 'tanh', 'trunc' ]
(Firefox.47)
> Object.getOwnPropertyNames(Math).sort()
[ 'E', 'LN10', 'LN2', 'LOG10E', 'LOG2E', 'PI', 'SQRT1_2', 'SQRT2', 'abs', 'acos', 'acosh', 'asin', 'asinh', 'atan', 'atan2', 'atanh', 'cbrt', 'ceil', 'clz32', 'cos', 'cosh', 'exp', 'expm1', 'floor', 'fround', 'hypot', 'imul', 'log', 'log10', 'log1p', 'log2', 'max', 'min', 'pow', 'random', 'round', 'sign', 'sin', 'sinh', 'sqrt', 'tan', 'tanh', 'toSource', 'trunc' ]
(Edge.25)
> Object.getOwnPropertyNames(Math).sort()
[ 'E', 'LN10', 'LN2', 'LOG10E', 'LOG2E', 'PI', 'SQRT1_2', 'SQRT2', 'abs', 'acos', 'acosh', 'asin', 'asinh', 'atan', 'atan2', 'atanh', 'cbrt', 'ceil', 'clz32', 'cos', 'cosh', 'exp', 'expm1', 'floor', 'fround', 'hypot', 'imul', 'log', 'log10', 'log1p', 'log2', 'max', 'min', 'pow', 'random', 'round', 'sign', 'sin', 'sinh', 'sqrt', 'tan', 'tanh', 'trunc' ]
Description::
The core idea behind promises is that a promise represents the result of an asynchronous operation. A promise is in one of three different states:
pending - The initial state of a promise.
fulfilled - The state of a promise representing a successful operation.
rejected - The state of a promise representing a failed operation.
Once a promise is fulfilled or rejected, it is immutable (i.e. it can never change again).
[https://www.promisejs.org/]
Name::
* cpt.Ljs-Promise-function,
* cpt.Promise-function-of-javascript,
Member::
// ljn.6-3-1
// Object.getOwnPropertyNames(Promise).sort()
[ 'accept', 'all', 'defer', 'length', 'name', 'prototype', 'race', 'reject', 'resolve' ]
// Object.getOwnPropertyNames(Promise.prototype).sort()
[ 'catch', 'chain', 'constructor', 'then' ]
===
// Chrome.52
// Object.getOwnPropertyNames(Promise).sort()
["all", "length", "name", "prototype", "race", "reject", "resolve"]
// Object.getOwnPropertyNames(Promise.prototype).sort()
[ 'catch', 'constructor', 'then' ]
Resource:
* https://promisesaplus.com/,
Description::
The decodeURI() function decodes a Uniform Resource Identifier (URI) previously created by encodeURI or by a similar routine.
Syntax
decodeURI(encodedURI)
[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURI]
Name::
* cpt.decodeURI-function-of-javascript,
* cpt.Ljs-decodeURI-function,
Code.ljs:
> decodeURI('https://el.wikipedia.org/wiki/
%CE%91%CE%BB%CE%AD%CE%BA%CE%BF%CF%82_%CE%86%CF%87%CE%BF%CE%BB%CE%BF%CF%82')
< "https://el.wikipedia.org/wiki/Αλέκος_Άχολος"
Descripton:
NativeNo-API is an-API with custom-semantic-units, vanilla or not.
Name::
* cpt.Ljs-API.nativeNo,
* cpt.Ljs-builtinNo-API,
* cpt.Ljs-nativeNo-API,
Descripton:
Events are DOINGS that trigger|call functions (listeners).
Description::
Phrases[1] are whole-constructs of semantic-unit NAMES to denote relations of their archetypes that[1] cannot exist autonomously inside the-algorithm.
Name::
* cpt.Ljs-phrase,
* cpt.Ljs-phrase,
* cpt.Ljs-semantic-unit-structures,
* cpt.Ljs-semantic-unit-structures,
* cpt.Ljs-sus,
* cpt.Ljs-sus,
Whole-chain::
* Ljs-sentence,
Part::
* Ljs-semantic-unit,
Description::
Code-phrase is a-phrase written in code-format.
Examples:
o.member
a[3]
2 + 3
if (b)
Name::
* cpt.Ljs-phrase.code,
* cpt.Ljs-phrase.code,
* cpt.Ljs-code-phrase,
* cpt.Ljs-code-phrase,
Description::
Sentences are whole-constructs of semantic-units, Ljs-phrases and even other sentences that exists autonomously inside the-algorithm.
The-algorithm is a-whole-part-tree structure of sentences.
Name::
* cpt.Ljs-sentence,
* cpt.Ljs-statement,
* cpt.Ljs-sentence,
* cpt.Ljs-statement,
* cpt.Sentence-of-javascript,
* cpt.Statement-of-javascript,
Whole-chain::
* Ljs-program,
Part::
* Ljs-ljs-phrase,
* Ljs-semantic-unit,
SPECIFIC.alphabetically:
* assignment-sentence,
* block-sentence,
* break-sentence,
* creation-sentence,
* conditional-sentence,
* continue-sentence,
* control-sentence,
* definition-sentence,
* delete-sentence,
* do-while-sentence,
* for-sentence,
* generic-sentence,
* genericNo-sentence,
* if-sentence,
* Immediately-invoked-function-expression,
* instance-sentence,
* instanceNo-sentence,
* label-sentence,
* loop-sentence,
* return-sentence,
* simple-sentence,
* simpleNo-sentence,
* switch-sentence,
* while-sentence,
SPECIFIC_DIVISION.instance:
* instance-sentence (genericNo): has no specifics,
* instanceNo-sentence (generic),
SPECIFIC_DIVISION.simple:
* simple-sentence: denotes one relation or doing,
* simpleNo-sentence,
Description::
Assignment-sentence is a-sentence that puts|assigns a-value in a-name-value-pair.
Code:
n = 3;
s = "text";
Name::
* cpt.Ljs-assignment-sentence,
* cpt.Ljs-assignment-sentence,
* cpt.Ljs-assignment-statement,
* cpt.Ljs-assignment-statement,
Description::
Block-sentence is a-sentence that contains an-order-set of other sentences.
Code:
{
sentence1;
sentence2;
...
}
Name::
* cpt.Ljs-block-sentence,
* cpt.Ljs-block-sentence,
* cpt.Ljs-block-statement,
* cpt.Ljs-block-statement,
Description::
Definitions are sentences that create instances of semantic-units.
In contrast to natural-languages, machines throw errors if a-sentence uses an undefined semantic-unit!!!
Name::
* cpt.Ljs-declaration,
* cpt.Ljs-definition-sentence,
* cpt.Ljs-definition-statement,
* cpt.Ljs-declaration,
* cpt.Ljs-definition-sentence,
* cpt.Ljs-definition-statement,
* cpt.Declaration-of-javascript,
* cpt.Definition-sentence-of-javascript,
* cpt.Definition-statement-of-javascript,
Specific::
* Function-definition,
* Name-value-pair--definition,
Description::
A-sentence that creates function instance.
Code:
function fName(input-variables) {
//function body
}
Name::
* cpt.Ljs-definition.function,
* cpt.Ljs-function-declaration,
* cpt.Ljs-function-definition-sentence,
* cpt.Ljs-definition.function,
Description::
A-sentence that creates a-semantic-unit with a-reference-name.
Code:
var n;
var n = 3;
const n = 3;
let n = 3;
Name::
* cpt.Ljs-definition.variable,
* cpt.Ljs-name-value-pair-definition,
* cpt.Ljs-nvp,
* cpt.Ljs-variable,
* cpt.Ljs-variable-declaration,
* cpt.Ljs-variable-definition-sentence,
* cpt.Ljs-variable-statement,
* cpt.Ljs-definition.variable,
* cpt.Ljs-name-value-pair-definition,
* cpt.Ljs-variable,
* cpt.Ljs-nvp,
* cpt.Ljs-v,
* cpt.Ljs-variable-declaration,
* cpt.Ljs-variable-definition-sentence,
* cpt.Ljs-variable-statement,
* cpt.Variable-of-javascript,
Generic-chain::
* Definition-sentence,
Description::
The-name of a-name-value-pair is-called idenfier.
An-identifier must start with a letter, underscore (_), or dollar sign ($); subsequent characters can also be digits (0-9).
Name::
* cpt.Ljs-identifier,
* cpt.Ljs-reference-name,
* cpt.Ljs-variable-name,
* cpt.Ljs-variable-reference,
* cpt.Ljs-identifier,
Description::
Valuename|typename is an-identifier which denotes its value|type.
Since {2014.08.05} I am-using typenames in my code, which makes the-code much more readable.
Name::
* cpt.Ljs-typename,
* cpt.Ljs-valuename,
* cpt.Typename,
* cpt.Valuename,
Specific::
In javascript we need only 11 typenames to denote ALL its types:
01) aName for Arrays,
02) bName for Booleans,
03) fName for Functions,
04) lName for nuLl,
05) mName for Modules,
06) nName for Numbers,
07) oName for Objects,
08) rName for Regexps,
09) sName for Strings,
10) uName for Undefined,
11) xName for miXed-name-value-pairs,
Description::
The-information we assign in the-name of a-name-value-pair is-called value.
Specific::
* const-nvp,
* let-nvp,
* var-nvp,
===
* array-nvp (var a = []),
* boolean-nvp (var b = true),
* function-nvp (var f = function(){}),
* module-nvp (var m = require('os')),
* number-nvp (var n = 3),
* object-nvp (var o = {}),
* regexp-nvp (var r = /x/),
* string-nvp (var s = 'a-string'),
* mixed-nvp,
* mixedNo-nvp,
Specific::
* mixed-name-value-pair--semantic-unit,
* mixedNo-name-value-pair--semantic-unit,
MixedNo-name-value-pair--semantic-unit:
Description::
MixedNo-name-value-pair is a-name-value-pair which ASSOCIATES only ONE type of value with a-name.
Name::
* cpt.Ljs-mixedNo-semantic-unit,
* cpt.Ljs-mixedNo-semantic-unit,
* cpt.Ljs-mixedNo-name-value-pair--semantic-unit,
* cpt.Ljs-mixedNo-name-value-pair--semantic-unit,
* cpt.Ljs-mixedNo-sut,
* cpt.Ljs-mixedNo-sut,
Description::
The const
declaration creates a read-only reference to a value.
It does not mean the value it holds is immutable, just that the variable identifier cannot be reassigned.
[https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Statements/const]
Name::
* cpt.Ljs-const-name-value-pair,
* cpt.Ljs-const-name-value-pair,
* cpt.Ljs-constant,
* cpt.Ljs-const,
* cpt.Ljs-const,
Description::
The let statement declares a block scope local variable, optionally initializing it to a value.
[https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Statements/let]
Name::
* cpt.Ljs-let-name-value-pair,
* cpt.Ljs-let-name-value-pair,
* cpt.Ljs-let,
* cpt.Ljs-let,
Description::
The scope of a variable declared with var
is its current execution context, which is either the enclosing function or, for variables declared outside any function, global.
[https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Statements/var]
Name::
* cpt.Ljs-var-name-value-pair,
* cpt.Ljs-var-name-value-pair,
* cpt.Ljs-var,
* cpt.Ljs-var,
Description::
Ljs-section is a-whole-construct of Ljs-sentences.
Description::
Algo-root-tree is the OUTERMOST TREE of an-algorithm, in a-webpage.
Name::
* cpt.Ljs-algo--root-tree,
* cpt.Ljs-algo--root-tree,
* cpt.Ljs-algo--root,
Description::
With the-language programers create many algorithms.
The-quantity depends on the-archetypes known, and the-semantic-units of the-language.
Name::
* cpt.Ljs-algo.specific,
Specific::
* Ljb-algorithm,
* Ljn-algorithm,
===
* Browser-managing,
* Codomain,
* Event-managing,
* HML-managing,
* Library,
* Math-managing,
* Number-managing,
* Package-managing,
* Program,
* Time-managing,
Description::
An-algorithm is an-INSTANCE of communication.
The-set of all algorithms is the-codomain of the-language.
Name::
* cpt.Array-managing.javascript,
* cpt.Ljs-array-managing,
* cpt.Ljs-algo.array-managing,
Specific::
* Array-of-array-primitives.remove-duplicates,
* Array-of-array.sort,
Code::
//returns the-index of array-part or -1
function fArray_includes_array(aWhole, aPart){
var nI, nJ, aCurrent;
for(nI = 0; nI < aWhole.length; ++nI){
if(aPart.length === aWhole[nI].length){
aCurrent = aWhole[nI];
for(nJ = 0; nJ < aPart.length && aPart[nJ] === aCurrent[nJ]; ++nJ);
if(nJ === aPart.length)
return nI;
}
}
return -1;
}
[https://stackoverflow.com/a/19543566]
Name::
* cpt.Array-of-array.includes.javascript,
* cpt.Ljs-array-of-array.includes,
* cpt.Ljs-algo.array-of-array.includes,
Code::
function fArrayRemoveDupl(aIn) {
//aIn = [[1,2],[3,4],[1,2],[1,3]]
//aOut = [[1,2],[3,4],[1,3]]
var
aHelp = [],
aOut = [],
sElt;
for(var n = 0; n < aIn.length; n++) {
sElt = aIn[n].join('|');
if(!aHelp.includes(sElt)) {
aHelp.push(sElt);
aOut.push(aIn[n]);
}
}
return aOut;
}
Name::
* cpt.Array-of-array-primitives.remove-duplicates.javascript,
* cpt.Ljs-array-of-array-primitives.remove-duplicates,
* cpt.Ljs-algo.array-of-array-primitives.remove-duplicates,
Code::
//a = [[1,2],[3,4],[2,2],[1,3]]
//sort on first element: [[1,2],[1,3],[2,2],[3,4]]
a.sort(fCompare1);
function fCompare1(aA, aB) {
return aA[0] > aB[0] ? 1 : -1;
}
===
//sort on second element: [[1,2],[2,2],[1,3],[3,4]]
a.sort(fCompare2);
function fCompare2(aA, aB) {
return aA[1] > aB[1] ? 1 : -1;
}
Name::
* cpt.Array-of-array.sort.javascript,
* cpt.Ljs-array-of-array.javascript,
* cpt.Ljs-algo.array-of-array.javascript,
Description::
An-algorithm is an-INSTANCE of communication.
The-set of all algorithms is the-codomain of the-language.
Name::
* cpt.Ljs-codomain,
* cpt.Ljs-domainOut,
* cpt.Ljs-codomain,
* cpt.Ljs-domainOut,
Description::
Date related algorithms.
Name::
* cpt.Ljs-date-managing,
* cpt.Ljs-algo.date-managing,
AddressWpg::
* https://javascript.info/date,
SPECIFIC::
* Format-date-to-YYY-MM-DD,
Code.ljs::
function fDateYMD() {
var
oD, sY, sM, sD;
oD = new Date();
sY = oD.getFullYear().toString();
sM = (oD.getMonth() + 1).toString();
if (sM.length === 1) {
sM = "0" + sM;
}
sD = oD.getDate().toString();
if (sD.length === 1) {
sD = "0" + sD;
}
return sY + "-" + sM + "-" + sD;
}
Name::
* cpt.Ljs-date.YYYY-MM-DD,
* cpt.Ljs-algo.date.YYYY-MM-DD,
Description::
Doings with objects.
Name::
* cpt.Ljs-object-managing,
* cpt.Ljs-algo.object-managing,
SPECIFIC::
* Find-key-by-value,
* member-counting,
* member-deleting,
* member-existance,
Code.ljs::
[1,3] === [1,3] //false
a = [1,3]
b = [1,3]
a === b //false
c = a
a === c //true
a == c //true
Name::
* cpt.Ljs-object-equality,
* cpt.Ljs-algo.object-equality,
Code.ljs::
//input: object, value
//output: key of value
function fObjvalRKey(oIn, valIn) {
return Object.keys(oIn).find(
function(key){
return oIn[key] === valIn
}
);
}
Name::
* cpt.Ljs-object-find-key-by-value,
* cpt.Ljs-algo.object-find-key-by-value,
Code.ljs::
Object.keys(o).length
Name::
* cpt.Ljs-object-member-counting,
* cpt.Ljs-algo.object-member-counting,
Code.ljs::
var o = {a:1, b:2};
var mbr = 'a';
delete o[mbr];
delete o['a'];
delete o.a
Name::
* cpt.Ljs-object-key-deleting,
* cpt.Ljs-object-member-deleting,
* cpt.Ljs-algo.object-member-deleting,
Code.ljs::
var o = {a:1, b:2};
'a' in o //true, search IN ITS GENERIC-CHAIN
o.hasOwnProperty('a') //true, search NOT in generic-chain
Name::
* cpt.Ljs-object-key-existance,
* cpt.Ljs-object-member-existance,
* cpt.Ljs-algo.object-member-existance,
Code.ljs::
All methods that iterate over property keys do so in the same order:
- First all Array indices, sorted numerically.
- Then all string keys (that are not indices), in the order in which they were created.
- Then all symbols, in the order in which they were created.
So yes, JavaScript objects are in fact ordered, and the order of their keys/properties can be changed.
Here’s how you can sort an object by its keys/properties, alphabetically:
const unordered = {
'b': 'foo',
'c': 'bar',
'a': 'baz'
};
console.log(JSON.stringify(unordered));
// → '{"b":"foo","c":"bar","a":"baz"}'
const ordered = {};
Object.keys(unordered).sort().forEach(function(key) {
ordered[key] = unordered[key];
});
console.log(JSON.stringify(ordered));
// → '{"a":"baz","b":"foo","c":"bar"}'
Use var instead of const for compatibility with ES5 engines.
[https://stackoverflow.com/a/31102605]
Name::
* cpt.Ljs-object-member-sorting,
* cpt.Ljs-algo.object-member-sorting,
Description::
Algo-library is an-algorithm which can-not-RUN autonomously, but inside another algo.
In other words, a-library HAS-NO an-executing-entry-point, like a-program.
A-library is a-container of NEW semantic-units and so has an-API.
Name::
* cpt.Ljs-algo.library,
* cpt.Ljs-library,
* cpt.Ljs-framework,
* cpt.Ljs-plugin,
* cpt.Ljs-algo--library,
* cpt.Ljs-algo.library,
* cpt.Ljs-library,
* cpt.Ljs-framework,
* cpt.Ljs-plugin,
* cpt.Ljs-lbr,
Whole-chain::
* Ljs-program,
Part::
* Ljs-sentence,
Description::
In Ljb you use the-hml-element script
.
In Ljn with require()
because a-library is a-module.
Specific::
* Ljb-library,
* Ljn-library,
===
* vanilla-library,
* vanillaNo-library,
Description::
Vanilla-library is a-library that uses ONLY native-API.
Name::
* cpt.Ljs-vanilla-library,
* cpt.Ljs-library.vanilla,
* cpt.Vanilla-library,
Description::
Ljs-program is an-algorithm which can-RUN autonomously, written in code-format.
In other words, a-program HAS an-executing-entry-point.
A-program is a-container of NEW semantic-units and so has an-API.
Name::
* cpt.Ljs-algo--program,
* cpt.Ljs-algo.program,
* cpt.Ljs-algo--program,
* cpt.Ljs-program,
* cpt.Ljs-program,
Part::
* Ljs-library,
* Ljs-sentence,
Description::
Ljs-program-execution is the-process of commanding it to work.
Ljb and Ljn programs are-executed very differently.
An-ljb-program is just opened on the-browser.
An-ljn-program is executing on command-line: node file-of-pgm
Name::
* cpt.Ljs-program'execution,
* cpt.Ljs-program'execution,
* cpt.Ljs-pgm'call,
* cpt.Ljs-pgm'execution,
* cpt.Ljs-pgm'invocation,
* cpt.Ljs-pgm'open,
* cpt.Ljs-pgm'run,
Specific::
* Ljb-program,
* Ljn-program,
Description::
Ljs-package is a-library or a-program PLUS metadata describing the-code.
Name::
* cpt.Ljs-package,
* cpt.Ljs-package,
* cpt.Ljs-pkg,
Package-dependency:
Package-dependency is any other external package IMPORTED into current package.
Package-manager:
(linkL)
Specific::
* ljb-package,
* ljn-ljspackage,
===
* bower-package,
* npm-package,
Description::
The-code is understood by machines indirectly.
Machines directly understand only binary-information.
Therefore, the-code is-translated (with programs) in a-binary-format (binary-code) inside the-machine in order to be-executed.
Name::
* cpt.Ljs-binary-code,
* cpt.Ljs-binary-code,
* cpt.Ljs-bcode,
Name::
* cpt.Ljs-evaluation,
* cpt.Ljs-evaluation,
Its code is-created FROM only 12 semantic-units.
Javascript-objects do-not-inherit members from other special constructs like 'classes' (like java), but just from other objects.
This simple and powerful characteristic, called 'prototype-based-inheritance' confused programers who knew 'class-based-inheritance'.
Another cause of this confusion is the incorrect use of 'instanceof' by the-language designers.
Also constructor-functions mimic classes, especially with the-new-operator.
I have-created a full desktop browser program, which does-NOT-use a-single custom-constructor!!!
ECMAScript.6.2015 decision to add and classes, is wrong, because it creates an EXTRA semantic-unit, the-class, to implement inheritance[1] which[1] is already implemented with the-prototype-system.
Node.js implementation of 'classes' is-done by creating special functions.
Today builtin identifiers do-not-convey information about their values.
Since {2014.08.05}, I am-using valuenames in my code, which makes the-code much more readable.
Also this way we can-have type checking at write-time.
Description::
'Instance' is a-specific-concept with no more specifics.
'My-car' is an-instance of 'car'.
Ljs-objects-created-from-constructors ARE NOT INSTANCES of their constructor.
They are instances of the-Constructor.prototype-object.
THEN the-instanceof operator is a design name-mistake of javascript.
The-confusion came from class-based-languages where the-objects are indeed instances of classes.
objectof
is a better name.
[https://twitter.com/BrendanEich/status/734118379036934144]
Description::
Today, ljs, has only 'function-scope'.
This means, that a-name-value-pair defined inside a-function, can be used all over inside this function.
In other names, the-members of a-function see each other.
We do-not-have this feature inside objects, and to overcome it, we use constructors, or object-returning-functions.
Code-example:
var o = {n1:1, n2:n1} //throws Uncaught ReferenceError
var f=function(){var n1=1; var n2=n1;} //no Error
In my opinion Ljs needs:
1) Valuenames.
2) Object-scope.
3) No constructors.
Objects could-be-created by 1) functions like Object.create(), 2) functions returning objects (factories), and 3) literal-objects.
The-generic-chain to be: object > objectSpc > objectSpc > ...
And NOT: Object.prototype > Constructor.prototype > Constructor.prototype ...
Description::
Any human related to the-language.
Name::
* cpt.Ljs-human,
* cpt.Ljs-human,
* cpt.Ljs-hmn,
Description::
Creator is any human who contributed in the-creation of the-language.
Name::
* cpt.Ljs-creator,
* cpt.Ljs-creator,
Specific::
* Designer: the-human who created the-spec of the-language,
* Implementor: the-human who created the-code to binary-code translator,
Description::
Programer is a-human who creates programs.
Name::
* cpt.Ljs-programer,
* cpt.Ljs-programer,
* cpt.Ljs-pmr,
Description::
User is a-human who uses|runs a-program.
Description::
Jeremy-Ashkenas, creator of CoffeeScript, maintains a big list with languages that compile to javascript at:
https://github.com/jashkenas/coffeescript/wiki/List-of-languages-that-compile-to-JS.
Description::
My goal to write this page, is to help the-learning of the-language from a-linguistic perspective.
My second innovation is the-representation of the-subject.
I am-not-writing down a-bla-bla-text describing the-subject, repeating characteristics here and there.
I am-writing STRUCTURED-CONCEPTS|ModelConceptStructureds in ONE format.
You can-read the-concept of javascript sequentially OR you can-search for a-characteristic and from there to reach any related concept.
Name::
cpt.ljs'learning,
cpt.ljslearning,
Resource:
* https://developer.mozilla.org/en-US/Learn/JavaScript,
* https://www.codementor.io/learn-javascript-online,
Specific::
* learning-browser-javascript,
* learning-Node-javascript,
Description::
Specification is a-text-document that describes|defines a-language.
ECMA-International creates the-specs for Ljs.
ECMA-International creates many standards.
ECMA-262 is the-standard that defines the-ECMAScript-language, as it calls the-ljs.
Specs are-published in pdf or HML format and are texts hard to read and multisemantic.
In current webpage-concept I TRY to describe the-language in monosemantic English by defining most of the-names of my sentences.
Name::
cpt.ECMAScript,
cpt.ljs'specification,
cpt.ljsspecification,
cpt.ljs'spec,
cpt.ljsspec,
cpt.lje,
Specific (versions):
* ECMAScript.6.2015 (ES6),
* ECMAScript.5-1.2011 (ES5.1),
* ECMAScript.5.1999 (ES5),
* ECMAScript.4 not existing (ES4),
* ECMAScript.3.1999 (ES3),
* ECMAScript.2.1998 (ES2),
* ECMAScript.1.1997 (ES1),
Description::
ECMAScript-2015 (6th edition) is the latest version.
Pdf-version.
HML-version.
Name::
* cpt.ECMAScript.6.2015,
* cpt.ECMAScript.2015.6,
* cpt.ECMA-262-6th-edition,
* cpt.ES2015-(ES6),
* cpt.ES2015.6,
* cpt.ES6-(ES2015),
* cpt.ES6.2015,
* cpt.Lje.2015.6,
* cpt.Lje.6.2015,
* cpt.Standard.ECMA.262.6-edition,
Compatibility:
* compatibility-table, Created by kangax.
* node.green, Node.js compatibility-table, Created by William-Kapke.
Description::
ECMAScript-5.1 is the-version previous to ECMAScript.6.2015, approved on {2011.June}.
My html5.id.toc.preview-version.
Pdf-version.
HML-version.
Name::
* cpt.Lje.51.2011,
* cpt.Lje.2011.51,
* cpt.ECMAScript.51.2011,
* cpt.ECMAScript-5.1,
* cpt.ECMA-262-5.1-edition,
* cpt.Standard.ECMA.262.51-edition,
Description::
Any program, used to work with the-language, write, execute, debug, analyze, test the-code.
===
Development tools
Within JavaScript, access to a debugger becomes invaluable when developing large, non-trivial programs. Because there can be implementation differences between the various browsers (particularly within the DOM]), it is useful to have access to a debugger for each of the browsers that a Web application targets.
Script debuggers are integrated within Internet Explorer, Firefox, Safari, Google Chrome, Opera and Node.js.
In addition to the native Internet Explorer Developer Tools, three debuggers are available for Internet Explorer: Microsoft Visual Studio is the richest of the three, closely followed by Microsoft Script Editor (a component of Microsoft Office), and finally the free Microsoft Script Debugger that is far more basic than the other two. The free Microsoft Visual Web Developer Express provides a limited version of the JavaScript debugging functionality in Microsoft Visual Studio. Internet Explorer has included developer tools since version 8.
In comparison to Internet Explorer, Firefox has a more comprehensive set of developer tools, which include a debugger as well. Old versions of Firefox without these tools used a Firefox addon called Firebug, or the older Venkman debugger. Also, WebKit's Web Inspector includes a JavaScript debugger, which is used in Safari. A modified version called Blink DevTools is used in Google Chrome. Node.js has Node Inspector, an interactive debugger that integrates with the Blink DevTools, available in Google Chrome. Last but not least, Opera includes a set of tools called Dragonfly.
In addition to the native computer software, there are online JavaScript IDEs, debugging aids are themselves written in JavaScript and built to run on the Web. An example is the program JSLint, developed by Douglas Crockford who has written extensively on the language. JSLint scans JavaScript code for conformance to a set of standards and guidelines. Many libraries for JavaScript, such as three.js, provide links to demonstration code that can be edited by users. They are also used as a pedagogical tool by institutions such as Khan Academy to allow students to experience writing code in an environment where they can see the output of their programs, without needing any setup beyond a Web browser.
[https://en.wikipedia.org/wiki/JavaScript#Development_tools {2016.08.08}]
Name::
* cpt.Ljs-development-tool,
* cpt.Ljs-programing-tool,
* cpt.Ljs-tool,
* cpt.Ljs-tool,
Name::
* cpt.Ljs-tool.specific,
* cpt.Ljs-tool.specific,
Specific::
* analysis-tool,
* build-tool,
* debugger-tool,
* editor-tool,
* interpreter-(runtime)-tool,
* package-manager,
* testing-tool,
===
* Ljb-tool,
* Ljn-tool,
Description::
A JavaScript engine is a program or library which executes JavaScript code.
A JavaScript engine may be a traditional interpreter, or it may utilize just-in-time compilation to bytecode in some manner.
Although there are several uses for a JavaScript engine, it is most commonly used in web browsers.
[https://en.wikipedia.org/wiki/JavaScript_engine {2016.07.25}]
Name::
* cpt.Ljs-engine,
* cpt.Ljs-javascript-engine,
* cpt.Ljs-interpreter,
* cpt.Ljs-runtime,
* cpt.Ljs-tool.engine,
Specific::
* browser-runtime,
* browserNo-runtime,
* desktop-runtime,
* Node.js-runtime,
* Google-V8-runtime,
Description::
V8 is Google's open source high-performance JavaScript engine, written in C++ and used in Google Chrome, the open source browser from Google.
It implements ECMAScript as specified in ECMA-262, and runs on Windows XP or later, Mac OS X 10.5+, and Linux systems that use IA-32, ARM or MIPS processors.
V8 can run standalone, or can be embedded into any C++ application.
[https://github.com/v8/v8/wiki]
Name::
* cpt.Ljs-v8,
* cpt.Ljs-Google-V8-engine,
* cpt.Ljs-Google-V8-javascript-engine,
Description::
Understanding JavaScript Package Managers
There are several JavaScript package managers: npm, bower, volo, ringojs, component. Currently, npm and bower have the most registered packages and enjoy the broadest third-party support.
Npm deals mainly in node-compatible JavaScript modules. However, bower focuses on the entire web platform, offering packages that could contain modules, scripts, CSS stylesheets, HTML templates, images, or fonts. For these reasons, npm tends to be used primarily for node.js development, and bower tends to be the favorite for client-side work.
While npm and bower use incompatible organizational patterns, both may be used in a single project since they use different metadata files (package.json and bower.json), and they install packages into different subdirectories. It's not uncommon to use npm to manage server-side packages and bower to manage client-side packages.
Unlike Java's Maven, JavaScript package managers concentrate mainly on finding packages, installing packages, and managing package versions. Npm also offers the ability to run simple build-related and test-related tasks.
Using JavaScript package managers
Getting started with package managers is straightforward. The following examples are for bower and npm, but similar concepts exist for the others.
After installing bower or npm, type bower init
or npm init
at the root directory of your project. The package manager will ask several questions. Your answers will be used to create a bower.json
or package.json
metadata file for your project.
To search for available packages to install, type bower search 'keywords'
or npm search 'keywords'
. A list of matching packages will be displayed.
To install a package into the local module cache and then copy its latest version into your project, type bower install 'package-name'
or npm install 'package-name'
. To install a specific version, the syntax varies slightly amongst package managers: bower install 'package-name'#'package-version'
or npm install 'package-name'@'package-version'
.
You may also save each package's version info into your project's metadata file. The package manager -- as well as other third-party tools -- can use the metadata to simplify client-side maintenance, build, testing, and bootstrapping tasks.
The best way to save a package's version info into your project's metadata file, is to use the --save option while installing the package. Type bower install --save 'package-name'#'package-version'
or npm install --save 'package-name'@'package-version'
.
[https://spring.io/understanding/javascript-package-managers]
Name::
* cpt.Ljs-tool.package-manager,
* cpt.Ljs-package-manager,
* cpt.Package-manager,
Specific::
* bower-package-manager,
* npm-package-manager,
Description::
Javascript doesn't support testing natively.
Name::
* cpt.Ljs-testing-tool,
* cpt.Ljs-tool.testing,
* cpt.Ljs-tool.testing,
Resource:
* https://www.sitepoint.com/javascript-testing-unit-functional-integration/ {2016.04.25},
* https://github.com/jasmine/jasmine,
Specific::
* Ljb-testing-tool,
* Ljn-testing-tool,
Name::
cpt.ljs.specific,
cpt.ljs'dialect,
cpt.ljsdialect,
Description::
A-javascript-dialect is a-programing-language with most of the-characteristics of Ljs, that a-programer 'speaks' and a-computer 'understands'.
If there is no a-compiler|interpreter there is no programing-language.
Today our theories about the-languages (human or computer) are incorrect to a significant extent, but the-languages exist before our theories about them.
ECMAScript, from this point of view, is not a-language, it is a-theory about Ljs.
Specific::
* Browser-javascript,
* BrowserNo-javascript,
* Desktop-javascript,
* Node-javascript,
* Server-javascript,
* ServerNo-javascript,
* Strict-javascript,
* StrictNo-javascript,
AddressWpg::
* {2017-06-21} JavaScript for Microcontrollers and IoT: https://auth0.com/,
Description::
Desktop-javascript (Ljd) is the-javascript for the-desktop.
Browser-js has no full access of the underline operating-system for security reasons.
Node-js has no GUI components.
Desktop-javascript combines the two technologies and creates cross-platform programs using only web-technologies, javascript, HTML and CSS.
Name::
* cpt.Desktop-javascript-language-(Ljd),
* cpt.Desktop-js-(javascript-for-desktop-programs),
* cpt.Language.javascript.desktop-(Ljd),
* cpt.Language.progaming.javascript.desktop-(Ljd),
* cpt.Ljd-(LanguageJavascriptDesktop),
* cpt.Programing-language.javascript.desktop,
Generic-chain::
* javascript-programing-language,
* programing-language,
* computer-language,
* mapping-method,
* method,
* info,
* model,
* entity,
Time: {2015}:
=== Node.js v4.0:
In September 2015, Node.js v0.12 and io.js v3.3 were merged back together into Node v4.0.
This brought V8 ES6 features into Node.js, and a long-term support release cycle.
As of 2016, the io.js website recommends that developers switch back to Node.js.
[https://en.wikipedia.org/wiki/Node.js#History]
Time: {2013}:
=== ISOMORPHIC-javascript:
In 2013, Airbnb was the first to use Node.js to provide isomorphic (also called universal or simply shared) javascript.
In the Node.js approach, the same framework is identically executed on the server side and client side.
On the server side, it provides an initial render of the page, and data could be provided through Node.js or through REST API calls.
On the client side, the framework binds to DOM elements, "rehydrates" (updates the initial server-side render provided by Node.js) the HTML, and makes asynchronous REST API calls whenever updated data is needed.
The biggest advantage Airbnb's javascript isomorphism had over Twitter's approach is the notion of a completely reusable rendering system.
Because the client-side framework is executed the same way on both server and client, rendering becomes much more manageable and debuggable in that the primary distinction between the server-side and client-side renders is not the language or templating system used, but rather what data is provisioned by the server and how.
From a prototype written in 10 days to being used across the stack by some of the largest websites in the world, long gone are the days of clunky browser implementations whose APIs changed depending on whether you were using Netscape or Internet Explorer.
It took javascript 20 years, but it is finally considered an equal partner to traditional, well-established server-side languages.
[http://buytaert.net/a-history-of-javascript-across-the-stack]
Time: {2009}:
=== Node.js:
Node.js was originally written in 2009 by Ryan Dahl.
Dahl demonstrated the project at the inaugural European JSConf on November 8, 2009.
Node.js combined Google's V8 javascript engine, an event loop and a low-level I/O API.
The project received a standing ovation.
[https://en.wikipedia.org/wiki/Node.js#History]
Time: {2008}:
=== V8, PERFORMANCE:
In 2008, Google launched Chrome with a faster javascript engine called V8.
The release announcement read:
"We also built a more powerful javascript engine, V8, to power the next generation of web applications that aren't even possible in today's browsers.".
At the launch, V8 improved javascript performance by 10x over Internet Explorer by compiling javascript code to native machine code before executing it.
This caught my attention because I had recently finished my PhD thesis on the topic of JIT compilation.
More importantly, this marked the beginning of different browsers competing on javascript performance, which helped drive javascript's adoption.
[http://buytaert.net/a-history-of-javascript-across-the-stack]
Time: {2005}:
=== Google Maps, Ajax:
A year later in 2005, Google launched Google Maps, which used the same technology as Gmail to transform online maps into an interactive experience.
With Google Maps, Google was also the first large company to offer a javascript API for one of their services allowing developers to integrate Google Maps into their websites.
Google's XMLHttpRequest approach in Gmail and Google Maps ultimately came to be called Ajax (originally "Asynchronous javascript and XML").
Ajax described a set of technologies, of which javascript was the backbone, used to create web applications where data can be loaded in the background, avoiding the need for full page refreshes.
This resulted in a renaissance period of javascript usage spearheaded by open source libraries and the communities that formed around them, with libraries such as Prototype, jQuery, Dojo and Mootools.
(We added jQuery to Drupal core as early as 2006.)
[http://buytaert.net/a-history-of-javascript-across-the-stack]
Time: {2004}:
=== Gmail:
For the first 10 years of javascript's life, professional programmers denigrated javascript because its target audience consisted of "amateurs".
That changed in 2004 with the launch of Gmail.
Gmail was the first popular web application that really showed off what was possible with client-side javascript.
Competing e-mail services such as Yahoo! Mail and Hotmail featured extremely slow interfaces that used server-side rendering almost exclusively, with almost every action by the user requiring the server to reload the entire web page.
Gmail began to work around these limitations by using XMLHttpRequest for asynchronous data retrieval from the server.
Gmail's use of javascript caught the attention of developers around the world.
Today, Gmail is the classic example of a single-page javascript app; it can respond immediately to user interactions and no longer needs to make roundtrips to the server just to render a new page.
[http://buytaert.net/a-history-of-javascript-across-the-stack]
Time: {1995}:
=== ANNOUNCEMENT:
MOUNTAIN VIEW, Calif. (December 4, 1995) -- Netscape Communications Corporation (NASDAQ: NSCP) and Sun Microsystems, Inc. (NASDAQ:SUNW), today announced javascript, an open, cross-platform object scripting language for the creation and customization of applications on enterprise networks and the Internet.
The javascript language complements Java, Sun's industry-leading object-oriented, cross-platform programming language.
The initial version of javascript is available now as part of the beta version of Netscape Navigator 2.0, which is currently available for downloading from Netscape's web site.
[https://web.archive.org/.../wp.netscape.com/newsref/pr/newsrelease67.html]
This page was visited times since {2016.05.04}
Page-path: synagonism.net / hitp / modelInfoWorld / javascript (ljs)
SEARCH THE-PAGE:
This page uses 'locator-names', names that when you find them, you find the-LOCATION of the-concept they denote.
Type CTRL+F "cpt.[ljs|ljb|ljn]words-of-concept's-name", to go to the-LOCATION of the-concept.
There are about 400 sub-concepts in this concept (ebook) with 1,400 names and 14,000 lines of hitp-document.
Webpage-Versions:
• version.dynamic: filMcsLjs.html,
• version.4.2017-07-11: filMcsLjs.4.2017-07-11.html,
• version.3.2016-08-22 (2-4): filMcsLjs.3.2016-08-22.html,
• version.2.2016-08-04.ljs-ljn (1-33): filCptLjs.2.2016-08-04.html,
• version.1-21.2016-05-26: lngJs.1-21.2016-05-26.html,
• version.1-17.2016-05-23: lngJs.1-17.2016-05-23.html,
• version.1-11.2016-05-18: lngJs.1-11.2016-05-18.html,
• version.1.2016-05-10.ljb.created: lngJs.1.2016-05-10.html,