Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function assignProperties([prop1, val1, prop2, val2, prop3, val3]){
- let obj = new Object();
- obj.prop1 = val1;
- obj.prop2= val2;
- obj.prop3 = val3;
- console.log(JSON.parse(`{ "${prop1}": "${obj.prop1}", "${prop2}": "${obj.prop2}", "${prop3}": "${obj.prop3}" }`));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement