Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript parse and validate json

const jsonStr = JSON.stringify({  
  foo: 'bar'  
})  
try {  
  const json = JSON.parse(jsonStr);  
} catch (e) {  
  console.log('invalid json');  
}
Source by thewebdev.info #
 
PREVIOUS NEXT
Tagged: #javascript #parse #validate #json
ADD COMMENT
Topic
Name
1+3 =