text to object code example Example 1: js string to object JSON.parse() Example 2: how to convert json to javascript object local storage JSON.parse