Set in Javascript | Set and Map | part1 #kody_az

Dərs haqqında

JavaScript-də Set, unikal dəyərlərin kolleksiyasını saxlayan bir obyektdir. Bu o deməkdir ki, Set yalnız hər dəyərdən birini saxlayır və təkrarlanan dəyərlər avtomatik olaraq silinir. Set obyekti elementləri saxlamaq və idarə etmək üçün metodlarla təchiz olunub.

Set-in əsas xüsusiyyətləri:

1) Unikal Dəyərlər: Set avtomatik olaraq bütün dəyərlərin unikal olmasını təmin edir. Əgər Set-ə artıq mövcud olan bir dəyər əlavə etməyə çalışsanız, o dəyər yenidən əlavə olunmayacaq.

2) Elementlərin Sırası: Set-də dəyərlər daxil edildiyi sırada saxlanılır. Set-i təkrar edərkən dəyərlər həmin sırada qaytarılacaq.

3) Sadə və Obyekt Tipləri: Set, həm sadə dəyərləri (məsələn, rəqəmlər, sətirlər və ya booleanlar), həm də obyektləri saxlaya bilər.

=======

In JavaScript, a Set is a collection of unique values. This means that a Set can only store one of each value, and duplicate values are automatically removed. The Set object lets you store and manage a collection of items, and it comes with methods to manipulate these items.

Key Features of Set:

1) Unique Values: A Set automatically ensures that all values are unique. If you add a value that already exists in the Set, it will not be added again.

2) Order of Elements: The values in a Set are stored in the order in which they were inserted. Iterating over a Set will return values in this order.

3) Primitive and Object Types: A Set can store any type of values, whether primitive (such as numbers, strings, or booleans) or objects.

#kody_az #kodyaz #js #javascript #nodejs #es6 #viral #viralcode #viralvideo #random #code #coder #azerbaycan #azerbaijan #baku #baki #programming #programmer #codes #hazırlıq #hazirliq #kurs #kurslar #course #courses #online #onlinecourses #test #quiz

YouTube-da bax · KODY.AZ