Created
May 18, 2018 19:40
-
-
Save angelorubin/40f7061bdd6b30fca8ef79c67258fe6d to your computer and use it in GitHub Desktop.
// source https://jsbin.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="description" content="Javascript - Converting Array to Object"> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<h1>Javascript - Converting Array to Object</h1> | |
<script id="jsbin-javascript"> | |
var arr = [ | |
{nome: 'maycon' , idade: '18'}, | |
{nome: 'maycon' , idade: '18'}, | |
{nome: 'maycon' , idade: '18'} | |
] | |
var obj = Object.assign({}, arr) | |
console.log(obj) | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">var arr = [ | |
{nome: 'maycon' , idade: '18'}, | |
{nome: 'maycon' , idade: '18'}, | |
{nome: 'maycon' , idade: '18'} | |
] | |
var obj = Object.assign({}, arr) | |
console.log(obj)</script></body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var arr = [ | |
{nome: 'maycon' , idade: '18'}, | |
{nome: 'maycon' , idade: '18'}, | |
{nome: 'maycon' , idade: '18'} | |
] | |
var obj = Object.assign({}, arr) | |
console.log(obj) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment