Operation | Time Complexity |
---|---|
Access | O(1) |
Search | O(n) |
Insertion | O(n) |
Deletion | O(n) |
-
An array is a data structure that stores a collection of elements, each identified by an index or a key.
-
Arrays provide a way to organize and access elements in a sequential manner.
-
Array indices in JavaScript start at 0. The first element is accessed using index 0, the second with index 1, and so on.
const arr = ['a', 'b', 'c', 'd'];
console.log(arr[1]); // b
Inspired by dannyfritz/commit-message-emoji
See also gitmoji.
Commit type | Emoji |
---|---|
Initial commit | 🎉 :tada: |
Version tag | 🔖 :bookmark: |
New feature | ✨ :sparkles: |
Bugfix | 🐛 :bug: |