---
title: "Discussion on \"15 must-know JavaScript array methods in 2020\" | Hashnode"
description: "Discussion on \"15 must-know JavaScript array methods in 2020\". Originally posted on my blog\nIn JavaScript, an array is a special variable that is used to store different elements. It has some built-in properties and methods we can use to add, remove, iterate, or manipulate data following our needs. And knowing J..."
url: "https://hashnode.com/posts/15-must-know-javascript-array-methods-in-2020/5e1c4cdd32d5fad159b694d3"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [15 must-know JavaScript array methods in 2020](https://hashnode.com/post/15-must-know-javascript-array-methods-in-2020?utm_source=hashnode&utm_medium=feed)

Originally posted on my blog In JavaScript, an array is a special variable that is used to store different elements. It has some built-in properties and methods we can use to add, remove, iterate, or manipulate data following our needs. And knowing J...

Jan 13, 2020 · hashnode.com  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#beginners](https://hashnode.com/tag/beginners)

## Written by

[Ibrahima Ndaw](https://hashnode.com/@ibrahima92)

@ibrahima92 · Senegal

  
[View profile](https://hashnode.com/@ibrahima92)

## Responses 1

Markdown supported · ⌘↵ to post

[Kamen Minkov](https://hashnode.com/@kamen)

[Jan 14, 2020](https://hashnode.com/posts/15-must-know-javascript-array-methods-in-2020/5e1c4cdd32d5fad159b694d3/comment/5e1d949832d5fad159b6a91e)

In the example you gave,

```
// Instead of using this way
myAwesomeArray.some(test => {
  if (test === "d") {
    return test
  }
})
// We'll use the shorter one
myAwesomeArray.some(test => test === "d")
```

the two functions are not equivalent. In the first case you return either an element of the array or `undefined` (as opposed to the real `boolean` returned by the second case). It will work here (as the returned value is either truthy or falsy), but might give you trouble in other cases. The long version of the second function would be the following:

```
myAwesomeArray.some(test => { return test === "d"); }
```
