Загрузка...

#JavaScriptTutorial | #Object Part 1

JavaScript Object-oriented Object-oriented (OO) languages usually are recognized through their use of classes for creating various objects which have similar properties and methods. It is to be noted that, ECMA-Script has no concept of classes, and hence objects are different than in class-based languages. ECMA-262 describes and classifies an object as an "unordered collection of dissimilar properties, each of them having a primitive value, object, or function." Firmly speaking, this means that an object is an array of all values in no specific order. Each property and method is recognized by a name that is mapped to a value. For this reason, it thinks of ECMA-Script objects as hash tables, i.e., nothing more than a combination of name-value pairs where the value may be data or a function. In JavaScript, we can define an object as a collection of properties that are defined as a key-value pair, where the key is the generic name of the object feature which can be assigned a value. Don't confuse this object with class objects, where we define a class and then create an object for it. In JavaScript, an object is a standalone entity where the properties of the object define the characteristics of the object. For example, if we consider the mobile phone as an object then its properties are its color, screen size, brand name, operating system, RAM, Memory, etc. All these properties define the characteristics of a mobile phone. The property of an object is a key:value pair, where key refers to a variable, and value refers to any type of value associated with the key. The value can be of any type like a number, string, or even an array, or another object. We can create a JavaScript object either by using the Object constructor or using the object literal syntax.

Видео #JavaScriptTutorial | #Object Part 1 автора JavaScript: работа с IoT-устройствами
Страницу в закладки Мои закладки
Все заметки Новая заметка Страницу в заметки