Shiki Twoslash
We’re using Shiki Twoslash to add compiler information to TypeScript and JavaScript code snippets.
ts
// @filename: maths.tsexport functionabsolute (num : number) {if (num < 0) returnnum * -1;returnnum ;}// @filename: index.tsimport {absolute } from "./maths.js";constvalue =absolute (-1);
ts
// @filename: maths.tsexport functionabsolute (num : number) {if (num < 0) returnnum * -1;returnnum ;}// @filename: index.tsimport {absolute } from "./maths.js";constvalue =absolute (-1);
Pretty neat, isn’t it?
ts
constwelcome = "Cześć";constProperty 'contains' does not exist on type '"Cześć"'.2339Property 'contains' does not exist on type '"Cześć"'.words =welcome .(" "); contains
ts
constwelcome = "Cześć";constProperty 'contains' does not exist on type '"Cześć"'.2339Property 'contains' does not exist on type '"Cześć"'.words =welcome .(" "); contains