Skip to content
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

Array sort #167

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
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
array-pop
  • Loading branch information
name committed Nov 8, 2022
commit 5c65668ebefd78f6de43a13e81b0f82a081ada81
2 changes: 1 addition & 1 deletion arrays/foreach.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Looping with Foreach
# Looping with Foreach

The forEach() method executes a provided function once for each array element.

10 changes: 10 additions & 0 deletions arrays/sort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Sorting an Array

The sort() method sorts the items of an array in a specific order (ascending or descending).

```javascript
var city = ["California", "Barcelona", "Paris", "Kathmandu"];

var sortedArray = city.sort();

console.log(sortedArray);