|
|
|
|
|
by AltruisticGapHN
1670 days ago
|
|
Simple object type in TypeScript, the "type checking" abstraction layer on top of JS, which actually doesn't even need to be compiled (eg. esbuild strips all typing from the code before compiling). https://www.typescriptlang.org/docs/handbook/2/everyday-type... Your approach is sensible. I remember using json_encode() indeed so I could declare some data in a php file with <<< HEREDOC in the Javascript short syntax (though short array syntax in php nowadays makes it less painful, JSON syntax still a bit less verbose). |
|