check if a string is a valid JSON string in JavaScript without using Try/Catch