Let's try : Javascript - data types

in #ua5 years ago


Javascript - data types
Javascript - типи даних




Data types
Типи даних
A data type provides a set of values from which an expression (i.e. variable, function...) may take its values. This data type defines the operations that can be done on the data, the meaning of the data, and the way values of that type can be stored. A type of value from which an expression may take its value.source

In this article, I will describe the types, and in the following we will acquainted with them in more detail.

Тип даних — характеристика, яку явно чи неявно надано об'єкту (змінній, функції, полю запису, константі, масиву тощо). Тип даних визначає множину припустимих значень, формат їхнього збереження, розмір виділеної пам'яті та набір операцій, які можна робити над даними.джерело

У цій статті опишу типи , а у наступних ми мудемо знайомитись з ними детальніше.


Number | Число

//example 1 | приклад 1
var i=1000;
var pi=3,1415;
The type number is used for both integer and fractional numbers (example 1). This type includes special numerical values of Infinity and NaN. Тип число використовується як для цілих так і для дробових чисел(приклад 1). Даний тип включає у себе спеціальні числові значення Infinity та NaN.

string | стрічка

//example 2 | приклад 2
var name = "John", country='Ukraine';
string type to save text information, quotes can be used as single or double. (example 2) тип стрічка для збереження текстової інформації, лапки можна використовувати як одинарні так і подвійні. (приклад 2)

boolean | Булевий(логічний)

//example 3 | приклад 3
var confirm=true;
var confirm=false;
The logical type stores one of two values true or false .(example 3) Логічний тип зберігає одне з двох значень true(істина) або false(хибно).(приклад 3)

null | відсутнє значення

//example 4 | приклад 4
var  cargoCount = null;
null does not refer to any of the types of language. Indicates that value in the variable is "nothing" .(example 4) null не відносить до жодного з типів мови. Вказує на те що значення у змінної "null" тобто "нічого".(приклад 4)

undefined

//example 5 | приклад 5
var a;
console.log("SHOW : ",a) // SHOW : undefined 
undefined an independent data type as null, consists of one value "undefined" and indicates that the variable is not assigned a value.(example 5) undefined самостійний тип даних як і null, складається з одного значення "undefined" та вказує на те що змінній не присвоєне значення.(приклад 5)

object | об'єкт

//example 6 | приклад 6
var currentUser = {
         name:"John",
         reputation:45
}
This type of data is used to build more complex structures and collections.(example 6) цей тип даних використовується для побудови більш складних структур , та колекцій.(приклад 6)

typeof

//example 7 | приклад 7

typeof 10 // "number"
typeof "foo" // "string"
typeof false // "boolean"
typeof undefined // "undefined"

typeof null // "object"  
typeof {} // "object"

typeof function(){} // "function"  
typeof is an operator that returns a variable type in a text format. In Example 7, as you have noticed, null is defined as an object, but we must remember that null is a self-sufficient data type and it is not an object, also a type of function - in fact it is a type of object, but in practice it is very it's convenient, you will be sure of this in the future. typeof це оператор який повертає тип змінної у текстовому форматі . У прикладі 7 як ви встигли помітити null визначається як об'єкт , але ми повинні пам'ятати що null самодостатній тип даних і об'єктом він не являється, також тип function - насправді це під тип об'єкту , але на практиці це дуже зручно , ми з вами в цьому впевнимось у подальшому .

In the future, we will consider in more detail each of the types in different articles of this cycle, sure that you will be interesting !!! У подальшому ми детальніше розглянемо кожен з типів у різних статтях цього циклу, впевнений вам буде цікаво!!!

Previous/Минулі :
- Let's try : Javascript - Variables(Correct variable name);
- Let's try : Javascript - Variables;


Дану інформацію ви також знайдете на теренах інтернету.
Інформація буде корисною новачкам.
СТАВТЕ ПАЛЕЦЬ У ВЕРХ!!! ПІДПИСУЙТЕСЬ!!!
КОМЕНТУЙТЕ!!!

You will also find this information on the Internet.
The information will be useful to newcomers.
SUBSCRIBE !!!COMMENT !!!



image source/джерело картинки


Sort:  

Hello! Your post has been resteemed and upvoted by @ilovecoding because we love coding! Keep up good work! Consider upvoting this comment to support the @ilovecoding and increase your future rewards! ^_^ Steem On!

Reply !stop to disable the comment. Thanks!

Congratulations! This post has been upvoted from the communal account, @minnowsupport, by mandarin2016 from the Minnow Support Project. It's a witness project run by aggroed, ausbitbank, teamsteem, someguy123, neoxian, followbtcnews, and netuoso. The goal is to help Steemit grow by supporting Minnows. Please find us at the Peace, Abundance, and Liberty Network (PALnet) Discord Channel. It's a completely public and open space to all members of the Steemit community who voluntarily choose to be there.

If you would like to delegate to the Minnow Support Project you can do so by clicking on the following links: 50SP, 100SP, 250SP, 500SP, 1000SP, 5000SP.
Be sure to leave at least 50SP undelegated on your account.

Coin Marketplace

STEEM 0.30
TRX 0.12
JST 0.033
BTC 64400.33
ETH 3140.71
USDT 1.00
SBD 3.93