Testing Syntax Highlighting
·1 min read·By Daniel Hillmann
Testing
JavaScript Example
Here's some JavaScript code:
function greet(name) {
const message = `Hello, ${name}!`;
console.log(message);
return message;
}
const result = greet('World');
TypeScript Example
And here's TypeScript with type annotations:
interface User {
id: number;
name: string;
email: string;
}
function fetchUser(id: number): Promise<User> {
return fetch(`/api/users/${id}`)
.then(response => response.json())
.then((data: User) => data);
}
const user: User = {
id: 1,
name: 'Daniel',
email: 'daniel@hillmann.dev'
};
Inline Code
You can also use inline code like const foo = 'bar' within paragraphs.