File tree Expand file tree Collapse file tree 1 file changed +23
-2
lines changed Expand file tree Collapse file tree 1 file changed +23
-2
lines changed Original file line number Diff line number Diff line change 11# JavaScript-snippets
2- > Click :star : if you like the project. Pull Request are highly appreciated. Follow us on [ Facebook] ( https://www.facebook.com/snippetsJS )
2+ > Click :star : if you like the project. Pull Request are highly appreciated. Follow us on [ Facebook] ( https://www.facebook.com/snippetsJS )
33
44### Table of Contents
55| No. | Questions |
4444| 38 | [ How to change the value of an object which is inside an array] ( #How-to-change-the-value-of-an-object-which-is-inside-an-array ) |
4545| 39 | [ Numeric separators allow us to improve our code readability] ( #Numeric-separators-allow-us-to-improve-our-code-readability ) |
4646| 40 | [ pay attention when using every] ( #pay-attention-when-using-every ) |
47-
47+ | 41 | [ How to convert an array of key-value tuples into an object ] ( #How-to-convert-an-array-of-key-value-tuples-into-an-object ) |
4848
4949
5050
@@ -880,6 +880,27 @@ console.log(result) //true
880880
881881
882882
883+ **[⬆ Back to Top](#table-of-contents)**
884+ ### How to convert an array of key-value tuples into an object
885+
886+
887+ ```javascript
883888
889+ const JSarr = [
890+ ['name', 'JSsnippets'],
891+ ['address', 'worldwide'],
892+ ['year', '2018'],
893+ ['followers', '15000']
894+
895+ ];
896+
897+ const obj = Object.fromEntries(JSarr);
898+ //{
899+ // " name" : " JSsnippets" ,
900+ // " address" : " worldwide" ,
901+ // " year" : " 2018 " ,
902+ // " followers" : " 15000 "
903+ //}
904+ ```
884905
885906
You can’t perform that action at this time.
0 commit comments