Skip to content

Getting started developer console #3547

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 27 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
75bd2a8
Merge pull request #1 from javascript-tutorial/master
mredem96 Nov 7, 2022
fcb6203
intro complete
akhmadali00 Nov 8, 2022
55f2d26
hello-world complete
akhmadali00 Nov 11, 2022
c025c13
strict-mode complete
akhmadali00 Nov 13, 2022
8b3e6e1
variables complete
akhmadali00 Nov 15, 2022
b04a0f8
type-conversions complete
akhmadali00 Nov 19, 2022
214e14c
operators complete
akhmadali00 Nov 20, 2022
682023c
switch complete
akhmadali00 Nov 20, 2022
5ddb074
comparison complete
akhmadali00 Nov 25, 2022
11aac96
ifelse complete
akhmadali00 Dec 1, 2022
be0b85b
logical-operators complete
akhmadali00 Dec 5, 2022
4caa614
nullish-coalescing complete
akhmadali00 Dec 6, 2022
2ea27a7
while/for complete
akhmadali00 Dec 7, 2022
66204d1
arrow-functions complete
akhmadali00 Dec 8, 2022
71aea02
js-specials complete
akhmadali00 Dec 8, 2022
bd7e6c0
getting-started done
akhmadali00 Dec 8, 2022
a7a7856
first-steps changes merged
akhmadali00 Dec 8, 2022
730de95
code-quality changes merged
akhmadali00 Dec 8, 2022
d392edd
object-basics changes merged
akhmadali00 Dec 8, 2022
c342d9d
primitives methods complete
akhmadali00 Dec 15, 2022
ca1a7ae
number complete
akhmadali00 Jan 2, 2023
9fd660c
strings complete
akhmadali00 Jan 3, 2023
93eb858
arrays incomplete
akhmadali00 Jan 5, 2023
43dd9c1
Merge remote-tracking branch 'ahmad/master' into HEAD
mredem96 Aug 8, 2023
89a2da0
Merge pull request #6 from akhmadali00/fixed
mredem96 Aug 8, 2023
acdef8e
developer console review
iroda743 Aug 15, 2023
f617c6a
devtools review
iroda743 Aug 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
arrays incomplete
  • Loading branch information
akhmadali00 committed Jan 5, 2023
commit 93eb8588b81fe543df63ae1ed74a792656210c5d
24 changes: 12 additions & 12 deletions 1-js/05-data-types/04-array/article.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
# Arrays
# Arrays (Massivlar)

Objects allow you to store keyed collections of values. That's fine.
Object-lar kalitlangan qiymatlar to'plamini saqlash imkonini beradi. Juda soz.

But quite often we find that we need an *ordered collection*, where we have a 1st, a 2nd, a 3rd element and so on. For example, we need that to store a list of something: users, goods, HTML elements etc.
Lekin ko'pincha bizga *tartibli to'plam* kerak bo'ladi, bunda 1, 2, 3-element va boshqalar mavjud. Masalan, biz biror narsa ro'yxatini saqlashimiz kerak: foydalanuvchilar, tovarlar, HTML elementlari va hokazo.

It is not convenient to use an object here, because it provides no methods to manage the order of elements. We can’t insert a new property “between” the existing ones. Objects are just not meant for such use.
Bu erda object-dan foydalanish noqulay, chunki unda elementlar tartibini boshqarish metodlari majud emas. Mavjud bo'lganlar "orasiga" yangi xossa kirita olmaymiz. Oject-lar shunchaki bunday foydalanish uchun mo'ljallanmagan.

There exists a special data structure named `Array`, to store ordered collections.
Tartiblangan to'plamlarni saqlash uchun `Array` nomli maxsus ma'lumotlar tuzilmasi mavjud.

## Declaration
## E'lon qilish

There are two syntaxes for creating an empty array:
Bo'sh massiv yaratishning ikkita sintaksisi mavjud:

```js
let arr = new Array();
let arr = [];
```

Almost all the time, the second syntax is used. We can supply initial elements in the brackets:
Deyarli har doim ikkinchi sintaksisdan foydalaniladi. Dastlabki elementlarni qavslar ichida berishimiz mumkin:

```js
let fruits = ["Apple", "Orange", "Plum"];
```

Array elements are numbered, starting with zero.
Array elementlari noldan boshlab raqamlangan bo'ladi.

We can get an element by its number in square brackets:
Biz elementni to'rtburchak qavslarda uning raqami orqali olishimiz mumkin:

```js run
let fruits = ["Apple", "Orange", "Plum"];
Expand All @@ -35,13 +35,13 @@ alert( fruits[1] ); // Orange
alert( fruits[2] ); // Plum
```

We can replace an element:
Biz elementni almashtirishimiz:

```js
fruits[2] = 'Pear'; // now ["Apple", "Orange", "Pear"]
```

...Or add a new one to the array:
...Yoki massivga yangisini qo'shishimiz mumkin:

```js
fruits[3] = 'Lemon'; // now ["Apple", "Orange", "Pear", "Lemon"]
Expand Down