Last active
March 21, 2025 13:15
-
-
Save gokhanozdemir/259d29a1ff06a661eb70a5b9768a6129 to your computer and use it in GitHub Desktop.
JavaScript'te sık kullanılan dizi metodları.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Must | |
| **Array Method** | **Mutates Original?** | **Syntax** | **Parametreler** | **Return** | **Return Data Type** | | |
|---------------------|------------------------------------|----------------------------------------------|----------------------------------------------------------------------------------|-------------------------------------------------|-----------------------------| | |
| `forEach()` | Hayır | `arr.forEach(callback(currentValue, index?, array?))` | Callback fonksiyonu. | `undefined`. | `undefined` | | |
| `map()` | Hayır | `arr.map(callback(currentValue, index?, array?))` | Callback fonksiyonu. | Her öğeyi değiştirilmiş yeni bir dizi. | `Array` | | |
| `filter()` | Hayır | `arr.filter(callback(currentValue, index?, array?))` | Callback fonksiyonu. | Testi geçen öğeleri içeren yeni bir dizi. | `Array` | | |
| `reduce()` | Hayır | `arr.reduce(callback(accumulator, currentValue, index?, array?), initialValue?)` | Callback fonksiyonu, başlangıç değeri (optional). | Tek bir değer (birikmiş sonuç). | `any` | | |
| `find()` | Hayır | `arr.find(callback(currentValue, index?, array?))` | Callback fonksiyonu. | Testi geçen ilk öğe. | `any` | | |
| `findIndex()` | Hayır | `arr.findIndex(callback(currentValue, index?, array?))` | Callback fonksiyonu. | Testi geçen ilk öğenin indeksi. | `number` | | |
## Good to Know | |
| **Array Method** | **Mutates Original?** | **Syntax** | **Parametreler** | **Return** | **Return Data Type** | | |
|---------------------|------------------------------------|----------------------------------------------|----------------------------------------------------------------------------------|-------------------------------------------------|-----------------------------| | |
| `some()` | Hayır | `arr.some(callback(currentValue, index?, array?))` | Callback fonksiyonu. | En az bir öğe testi geçerse `true`. | `boolean` | | |
| `every()` | Hayır | `arr.every(callback(currentValue, index?, array?))` | Callback fonksiyonu. | Tüm öğeler testi geçerse `true`. | `boolean` | | |
| `flat()` | Hayır | `arr.flat(depth?)` | (İsteğe bağlı) Derinlik düzeyi (default: `1`). | Yeni düzleştirilmiş dizi. | `Array` | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Must
forEach()
arr.forEach(callback(currentValue, index?, array?))
undefined
.undefined
map()
arr.map(callback(currentValue, index?, array?))
Array
filter()
arr.filter(callback(currentValue, index?, array?))
Array
reduce()
arr.reduce(callback(accumulator, currentValue, index?, array?), initialValue?)
any
find()
arr.find(callback(currentValue, index?, array?))
any
findIndex()
arr.findIndex(callback(currentValue, index?, array?))
number
## Good to Know
some()
arr.some(callback(currentValue, index?, array?))
true
.boolean
every()
arr.every(callback(currentValue, index?, array?))
true
.boolean
flat()
arr.flat(depth?)
1
).Array