#JSON.parse() error in typescript
13 messages · Page 1 of 1 (latest)
@dusky prawn Seems to work okay.
Preview:```ts
const abi = [ { "type": "function", "name": "empty", "inputs": [], "outputs": [], "state_mutability": "external" } ]
console.log(JSON.parse(abi))```
You can choose specific lines to embed by selecting them before copying the link.
thanks but abi should not be changed
Preview:```ts
const abi =
'[{\"type\": \"function\", \"name\": \"empty\", \"inputs\": [], \"outputs\": [], \"state_mutability\": \"external\"}]'
const abiJson = JSON.parse(
abi.replace(/\\\"/g, '\"')
)
console.log(abiJson)```
You can choose specific lines to embed by selecting them before copying the link.