---
title: "Comment by Kamen Minkov on \"15 must-know JavaScript array methods in 2020\" | Hashnode"
description: "In the example you gave, // Instead of using this way myAwesomeArray.some(test =&gt; { if (test === \"d\" ) { return test } }) // We'll use the shorter one myAwes"
url: "https://hashnode.com/posts/15-must-know-javascript-array-methods-in-2020/5e1c4cdd32d5fad159b694d3/comment/5e1d949832d5fad159b6a91e"
---

[Discussion](https://hashnode.com/posts/15-must-know-javascript-array-methods-in-2020/5e1c4cdd32d5fad159b694d3)

Comment [15 must-know JavaScript array methods in 2020](https://hashnode.com/posts/15-must-know-javascript-array-methods-in-2020/5e1c4cdd32d5fad159b694d3)

[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"); }
```
