---
title: "Discussion on \"10 JavaScript Tricks You Should Know\" | Hashnode"
description: "Discussion on \"10 JavaScript Tricks You Should Know\". Extract unique values :\n\nlet name = [ 'Aditi',  'Ayushi', ' Sanaya',  'Aditi',  'Aditi' ];\nlet newName = [...new Set(name)];\nconsole.log( newName);       // Output: [\"Aditi\", \"Ayushi\", \" Sanaya\"]\n\nSum of all numbers in an array\n\nlet num = [5, 3, 7, 2..."
url: "https://hashnode.com/posts/10-javascript-tricks-you-should-know/60d6f6cdde92ef110afdd8ae"
---

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

Discussion

# [10 JavaScript Tricks You Should Know](https://aditi2610.hashnode.dev/10-javascript-tricks-you-should-know?utm_source=hashnode&utm_medium=feed)

Extract unique values : let name = \[ 'Aditi', 'Ayushi', ' Sanaya', 'Aditi', 'Aditi' \]; let newName = \[...new Set(name)\]; console.log( newName); // Output: \["Aditi", "Ayushi", " Sanaya"\] Sum of all numbers in an array let num = \[5, 3, 7, 2...

Jun 26, 2021 · 2 min read · aditi2610.hashnode.dev  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#web-development](https://hashnode.com/tag/web-development)
-   [#tricks](https://hashnode.com/tag/tricks)
-   [#frontend-development](https://hashnode.com/tag/frontend-development)

## Written by

[Aditi Shree](https://hashnode.com/@Aditi2610)

@Aditi2610 · India

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

Third year CSE Student | Learning Frontend Dev | Exploring UI/UX | Open Source Enthusiast

I'm a Community taught developer

## Responses 1

Markdown supported · ⌘↵ to post

[Pranav Krishna](https://hashnode.com/@ppranav06)

[Jun 26, 2021](https://hashnode.com/posts/10-javascript-tricks-you-should-know/60d6f6cdde92ef110afdd8ae/comment/60d71a3dcb0aa8118c23b3f1)

Those tricks are amazing and they help in a person's daily life! Especially, the number to string conversion... I was impressed by that one!

Loved reading through this. Thank you 🙏

[Aditi Shree](https://hashnode.com/@Aditi2610)

[Jun 26, 2021](https://hashnode.com/posts/10-javascript-tricks-you-should-know/60d6f6cdde92ef110afdd8ae/comment/60d71a3dcb0aa8118c23b3f1#reply-60d7206dcb0aa8118c23b468)

welcome pranav
