Last active
August 9, 2022 16:16
-
-
Save ariefitriadin/8938be2c082cfddf81459194472b301b to your computer and use it in GitHub Desktop.
String to Object Eval
This file contains hidden or 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
let strObj = '[{50:4945},{51:4945},{52:4945},{56:4945},{57:4945},{66:4945},{71:4945},{73:4945},{93:4945}]'; | |
eval('var arrObj='+strObj); | |
//get value by key | |
let ts = arrObj.filter(obj => obj[51])[0][51]; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment