Previously, there was data of a specific type and it was interesting to process them in order to obtain a result. The dominance of “atypical ideas in the field of description” came unexpectedly, but naturally. A preliminary declaration of a variable has ceased to be mandatory, and an indication of its type has completely lost all meaning, at least before the operation in which it takes part.
The programmer untied his hands: it is not necessary to announce something at the beginning. Often, only at the time of use will there be certainty what to take, what to do and how. As for types, they themselves “became values”, that is, they became data, on which something also depends!
She’s already or not already, and so what
A very simple description of the variable "aaa" and an available algorithm for processing it:
var aaa ;
if (aaa) {
Res = 'I am!'; // !
} else {
Res = 'me no...'; //
}
: « ». JavaScript typeof = undefined. - « » . , aaa = 1, : « !», aaa = 0, : « ...». , , , , , . () !
JavaScript typeof, if (aaa) { ...x... } else { ...y... }, .
, , , . , 26 .
, , , , . : JavaScript typeof = undefined | string | number | boolean | object | function . , .
,
. - , , , , .
JavaScript , .
, , type text, JavaScript typeof . type text : , . , array.join(), text, .
: type text, JavaScript typeof . , . JavaScript typeof object :
var aaa = {};
Res = typeof(aaa);
Res += '/' + typeof window.document;
Res += '/' + typeof(document.forms[0]);
: object/object/object
typeof(aaa) typeof aaa - , , !
: , . , , . , , .
JavaScript typeof - , , . : , , .
, JavaScript typeof . , JavaScript typeof : - ! , .
- , . : , .