---
title: "Discussion on \"Snippets on Javascript ES6\" | Hashnode"
description: "Discussion on \"Snippets on Javascript ES6\". Destruction\n case: convert object\n const points = [\n   [4, 5],\n   [10, 1],\n   [0, 40]\n ];\n\n to \n [\n   { x: 4, y: 5},\n   { x: 10, y: 1},\n   { x: 0, y: 40}\n ]\n\n // ES5:\n points.map( pair => {\n     const x = pair[0];\n     const y = pair[1];\n });\n\n // ES..."
url: "https://hashnode.com/posts/snippets-on-javascript-es6/647b51cd10f4cf3fa31084be"
---

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

Discussion

# [Snippets on Javascript ES6](https://archerzou.hashnode.dev/snippets-on-javascript-es6?utm_source=hashnode&utm_medium=feed)

Destruction case: convert object const points = \[ \[4, 5\], \[10, 1\], \[0, 40\] \]; to \[ { x: 4, y: 5}, { x: 10, y: 1}, { x: 0, y: 40} \] // ES5: points.map( pair => { const x = pair\[0\]; const y = pair\[1\]; }); // ES...

Jun 3, 2023 · 3 min read · archerzou.hashnode.dev  
Updated Jun 6, 2023  
Read the article

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

## Written by

[Archer Zou](https://hashnode.com/@ArcherZou)

@ArcherZou · Suzhou, China

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

Software Developer

I'm a Software Developer focused on building high-quality, thoughtful, and intuitive websites and web applications.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
