Generation

generate functionSat, 12 Nov 2022

Parse json into interface

interface Person { name: string age: number } const json = '{"name": "John", age: 25}' function parse(json: string): Person { return JSON.parse(json) } const person = parse(json)

TypeScript
Generate More

Questions about programming?Chat with your personal AI assistant