Logo

dev-resources.site

for different kinds of informations.

JS Data types (Ma'lumot turlari)

Published at
5/31/2024
Categories
datatypes
Author
muxiddin
Categories
1 categories in total
datatypes
open
Author
8 person written this
muxiddin
open
JS Data types (Ma'lumot turlari)

JavaScriptda ikkita asosiy ma'lumotlar turi mavjud: primitiv va no primativ turlarga bo'linadi.


  • Primitiv Turlar

1. String

Matnli ma'lumotlarni ifodalaydi. Ikkita qo'shtirnoq ("...") 
yoki bitta qo'shtirnoq ('...') ichida yoziladi.
yoki bektik (`...`) ichida yoziladi

misol:

let str = "Hello, World!";
let str = 'Hello, World!';
let str = `Hello, World!`;
Enter fullscreen mode Exit fullscreen mode

2. Number

Butun va o'nlik (floating-point) sonlarni ifodalaydi.

misol:

let num = 42;
let pi = 3.14;
Enter fullscreen mode Exit fullscreen mode

3. Boolean

Mantiqiy qiymatlar: true yoki false.

misol:

let isTrue = true;
let isFalse = false;
Enter fullscreen mode Exit fullscreen mode

4. Null

Bitta qiymatni qabul qiladigan maxsus ma'lumot turi:
Null, Bu qiymat ob'ektning mavjud emasligini ifodalaydi.

Misol:

let emptyValue = null;
Enter fullscreen mode Exit fullscreen mode

5. Undefined

O'zgaruvchiga hech qanday qiymat tayinlanmaganligini ifodalaydi.

Misol:

let notAssigned;
console.log(notAssigned); // undefined
Enter fullscreen mode Exit fullscreen mode

6. Symbol

(ES6 dan boshlangan)
Yagona, o'zgarmas identifikatorlarni yaratish uchun ishlatiladi.

Misaol:

let sym = Symbol('description');
Enter fullscreen mode Exit fullscreen mode

7. BigInt

(ES11 dan boshlangan)
Katta butun sonlarni ifodalaydi bu sonlar Number tipida
ifodalanishi mumkin bo'lgan diapazondan kattaroq bo'ladi.

Misol:

let bigIntNumber = BigInt(9007199254740991);
Enter fullscreen mode Exit fullscreen mode

  • No Primativ turlar

Object

Kalit-qiymat juftliklarini saqlash uchun ishlatiladi.
Ob'ektlar moslashuvchan va ko'p maqsadli bo'lib,
bir nechta xususiyatlarga ega bo'lishi mumkin.

Misol:

let person = {
  name: "John",
  age: 30
};
Enter fullscreen mode Exit fullscreen mode

Array

Tartiblangan ro'yxat yoki kolleksiyani ifodalaydi.
Arraylar ob'ektning bir turi hisoblanadi.

Misol:

let numbers = [1, 2, 3, 4, 5];
Enter fullscreen mode Exit fullscreen mode

Function

Funksiyalar ham ob'ekt turlariga kiradi.Funksiya 
kod bo'lagini qayta ishlatish va bajarish uchun ishlatiladi.

Misol:

function greet(name) {
  return "Hello, " + name;
}
Enter fullscreen mode Exit fullscreen mode

Ma'lumotlar Turini Tekshirish

typeof

operatori yordamida o'zgaruvchining turini tekshirish mumkin:
Enter fullscreen mode Exit fullscreen mode

Image description

datatypes Article's
30 articles in total
Favicon
14. Longest Common Prefix - Using Trie
Favicon
Variables & Data types
Favicon
Handling Data in SQL: Signed vs. Unsigned Types
Favicon
Representação numérica na computação
Favicon
Understanding Floats in Python: Essential Tips and Examples
Favicon
Everything You Need to Know About Python Integers: Tips, Tricks, and Examples
Favicon
Understanding Python Data Types: A Comprehensive Guide
Favicon
Why I Revisited MS SQL Server Basics: A Deep Dive into String Data Types
Favicon
Understanding Data Types in JavaScript
Favicon
Disjoint Unions in C
Favicon
PYTHON-FUNDAMENTALS: CONSTANTS, VARIABLES AND DATA TYPES
Favicon
Understanding Your Data: The Essentials of Exploratory Data Analysis"
Favicon
Data Types of Typescript
Favicon
C# {Data Types except Int}
Favicon
Variables, Constants, Data Types, and Namespaces in C++
Favicon
Data Types in Python
Favicon
JS Data types (Ma'lumot turlari)
Favicon
Data Types
Favicon
C# da ratsional sonlar bilan ishlovchi (float, double, decimal) ma'lumot turlari
Favicon
Big Integer in Java
Favicon
Oracle Data Types: An Overview
Favicon
Understanding Float vs. Double in C and C++
Favicon
Data Types - Python
Favicon
The Art of Series Summation in C: Navigating Data Types, Casting Magic, and the Dance of Incrementation
Favicon
Understanding Why We Don't Use Pointers to change the value of the element in Slice Data Type in Go Lang!
Favicon
A step by step guide to Converting a Column to Date Data Type in a Dataset using R
Favicon
Choosing the Right Java Data Types
Favicon
Evolution of Ruby Data Types
Favicon
Composite Data types part 1
Favicon
Network Address Types in PostgreSQL. Why you need to know?

Featured ones: