<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/some-simple-and-amazing-javascript-tricks-lhmoly7nc" -->

---
title: Some simple and amazing JavaScript tricks | daily.dev
description: The spread syntax will copy all the properties of the object, but will only create a new object at the top level. For nested objects, the references of the...
canonical: https://daily.dev/posts/some-simple-and-amazing-javascript-tricks-lhmoly7nc
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Some simple and amazing JavaScript tricks | daily.dev
og:description: The spread syntax will copy all the properties of the object, but will only create a new object at the top level. For nested objects, the references of the...
og:url: https://daily.dev/posts/some-simple-and-amazing-javascript-tricks-lhmoly7nc
og:image: https://api.daily.dev/og/posts/LHMoLY7nC.png
og:image:alt: Some simple and amazing JavaScript tricks
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Some simple and amazing JavaScript tricks

**[JavaScript in Plain English](https://daily.dev/sources/jsPlainEnglish)** · 1 min read · 288 upvotes · 18 comments

## Summary

The spread syntax will copy all the properties of the object, but will only create a new object at the top level. For nested objects, the references of the inner objects will be copied and will not create new ones. You can simply do so by using the function in Array’s prototype.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://javascript.plainenglish.io/some-simple-and-amazing-javascript-tricks-292e1962b1f6?source=rss----4b3a1ed4f11c---4>

## Community discussion

Top comments from developers on daily.dev.

**@seb44** · 8 upvotes

> Why do we get 4 years old articles on daily news?

**@butterfly771** · 6 upvotes

> Basic grammar articles from four years ago should be reasonably labeled or else they will be perceived as attracting clicks,which is very bad

**@armandebussy** · 5 upvotes

> Grateful for these JavaScript tricks that will improve my coding!

**@srcmayte** · 4 upvotes

> Some nice little tricks there for beginners!

**@boumouzounabrahimvall** · 3 upvotes

> Helpful tricks, wish I knew the first one before.

## Similar posts on daily.dev

- [Don’t just attend KubeCon \+ CloudNativeCon, Merge Forward your experience\!](https://daily.dev/posts/don-t-just-attend-kubecon-cloudnativecon-merge-forward-your-experience--l0rpp73x8) · CNCF · 1 upvotes · 0 comments
- [Announcing H2 2026 KCDs](https://daily.dev/posts/announcing-h2-2026-kcds-m96goajm1) · CNCF · 1 upvotes · 0 comments
- [Two months of Open Community Groups](https://daily.dev/posts/two-months-of-open-community-groups-asf52zhbs) · CNCF · 0 upvotes · 0 comments

---

Tags: [#webdev](https://daily.dev/tags/webdev), [#javascript](https://daily.dev/tags/javascript)

[View this post on daily.dev](https://daily.dev/posts/some-simple-and-amazing-javascript-tricks-lhmoly7nc)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Some simple and amazing JavaScript tricks","url":"https://daily.dev/posts/some-simple-and-amazing-javascript-tricks-lhmoly7nc","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/some-simple-and-amazing-javascript-tricks-lhmoly7nc"},"datePublished":"2023-09-06T00:17:07.154Z","dateModified":"2023-09-06T00:16:48.103Z","description":"The spread syntax will copy all the properties of the object, but will only create a new object at the top level. For nested objects, the references of the...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/89eae1d9dcc28c723397328d6351faa7?_a=AQAEufR","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/89eae1d9dcc28c723397328d6351faa7?_a=AQAEufR","isAccessibleForFree":true,"articleSection":"JavaScript in Plain English","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"JavaScript in Plain English","logo":"https://media.daily.dev/image/upload/s--Dg5QTRuI--/f_auto,q_auto/v1686665538/logos/pe","url":"https://daily.dev/sources/jsPlainEnglish"},"commentCount":18,"discussionUrl":"https://daily.dev/posts/some-simple-and-amazing-javascript-tricks-lhmoly7nc","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":288},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":18}],"keywords":"webdev,javascript","timeRequired":"PT1M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"JavaScript in Plain English","item":"https://daily.dev/sources/jsPlainEnglish"},{"@type":"ListItem","position":3,"name":"Some simple and amazing JavaScript tricks"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/some-simple-and-amazing-javascript-tricks-lhmoly7nc","comment":[{"@type":"Comment","text":"Why do we get 4 years old articles on daily news?","datePublished":"2023-09-11T06:56:23.376Z","url":"https://daily.dev/posts/LHMoLY7nC#c-NhvoxrHsR","author":{"@type":"Person","name":"Seb","url":"https://daily.dev/seb44","image":"https://media.daily.dev/image/upload/s--O0TOmw4y--/f_auto/v1715772965/public/noProfile"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":8}},{"@type":"Comment","text":"Basic grammar articles from four years ago should be reasonably labeled or else they will be perceived as attracting clicks,which is very bad","datePublished":"2023-09-06T20:06:46.974Z","url":"https://daily.dev/posts/LHMoLY7nC#c-k1HvqqngF","author":{"@type":"Person","name":"Butterfly","url":"https://daily.dev/butterfly771","image":"https://avatars.githubusercontent.com/u/26669271?v=4"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":6}},{"@type":"Comment","text":"Grateful for these JavaScript tricks that will improve my coding!","datePublished":"2023-09-14T16:13:36.979Z","url":"https://daily.dev/posts/LHMoLY7nC#c-d6D9eHtEL","author":{"@type":"Person","name":"Arman Debussy","url":"https://daily.dev/armandebussy","image":"https://media.daily.dev/image/upload/s--O0TOmw4y--/f_auto/v1715772965/public/noProfile"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":5}},{"@type":"Comment","text":"Some nice little tricks there for beginners!","datePublished":"2023-09-06T03:40:16.310Z","url":"https://daily.dev/posts/LHMoLY7nC#c-wRmSAEXXH","author":{"@type":"Person","name":"Steve Clarke","url":"https://daily.dev/srcmayte","image":"https://media.daily.dev/image/upload/s--4SiyqKlB--/f_auto,q_auto/v1/avatars/avatar_X2IkraOGSjpjDzQSlPT9r"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":4}},{"@type":"Comment","text":"Helpful tricks, wish I knew the first one before.","datePublished":"2023-09-10T13:38:18.628Z","url":"https://daily.dev/posts/LHMoLY7nC#c-lZtN7nX0J","author":{"@type":"Person","name":"Boumouzouna Brahim Vall","url":"https://daily.dev/boumouzounabrahimvall","image":"https://avatars.githubusercontent.com/u/92952971?v=4"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":3}}]}
```

