---
title: "Comment by Chety on \"Super Useful Tips & Tricks for JavaScript Developers\" | Hashnode"
description: "Hey Yogesh Chavan Good tips thanks. By the way, I can add my two cents to your article. In getting the last element of the array section, in the first example a"
url: "https://hashnode.com/posts/super-useful-tips-and-tricks-for-javascript-developers/60a9eddb20d1f45ceb7eef74/comment/60ace3eff06aaf7b7c3e1110"
---

[Discussion](https://hashnode.com/posts/super-useful-tips-and-tricks-for-javascript-developers/60a9eddb20d1f45ceb7eef74)

Comment [Super Useful Tips & Tricks for JavaScript Developers](https://hashnode.com/posts/super-useful-tips-and-tricks-for-javascript-developers/60a9eddb20d1f45ceb7eef74)

[Chety](https://hashnode.com/@MereMala)

[May 25, 2021](https://hashnode.com/posts/super-useful-tips-and-tricks-for-javascript-developers/60a9eddb20d1f45ceb7eef74/comment/60ace3eff06aaf7b7c3e1110)

Hey [Yogesh Chavan](https://hashnode.com/@myogeshchavan97)

Good tips thanks. By the way, I can add my two cents to your article.

-   In getting the last element of the array section, in the first example `arr.slice(-1)` will return `[50]` not the value `50`.
-   For checking if it is an array I guess we can also use below code
    
    ```
     const isArray = Object.prototype.toString.call(arr) == "[object Array]"
    ```
    

[Yogesh Chavan](https://hashnode.com/@myogeshchavan97)

[May 25, 2021](https://hashnode.com/posts/super-useful-tips-and-tricks-for-javascript-developers/60a9eddb20d1f45ceb7eef74/comment/60ace3eff06aaf7b7c3e1110#reply-60ace7def06aaf7b7c3e11b7)

[Chety](https://hashnode.com/@MereMala) Thanks for pointing out my mistake. I have updated the article.

And thanks for mentioning another way for Array type check.

[ashpbt 123](https://hashnode.com/@Ashkhan)

[May 28, 2021](https://hashnode.com/posts/super-useful-tips-and-tricks-for-javascript-developers/60a9eddb20d1f45ceb7eef74/comment/60ace3eff06aaf7b7c3e1110#reply-60b08c595c02001765cf53cc)

[Yogesh Chavan](https://hashnode.com/@myogeshchavan97) Thanks for sharing helpful about js.
