json.parse to clone object
let method4 = JSON.parse(JSON.stringify(car))
// JSON.stringify(car)
// JSON.parse('{"mark":"Ford","model":"Raptor"}')

JSON.PARSE method just converts it into a string then parses so it can clone nested objects too
by Luka Tatarishvili
4 years ago
JavaScript
Objects tutorial 6
0
Pro tip: use ```triple backticks around text``` to write in code fences