Skip to main contentNedix.io

Kitchen sink

ECMAScript

// Candy class
class Candy {
/**
* A class representing a type of candy sold in the candy shop.
* @constructor
* @param {string} name - The name of the candy.
* @param {number} price - The price of the candy in dollars.
*/
constructor(name, price) {

TypeScript

// Classes and Interfaces
interface Person {
name: string;
birthDate: Date;
}
class Patient implements Person {
name: string = 'patientName';
birthDate: Date;