Focus mode

NEAR Developer Course

Classes

You will generally want to define your classes in a different file and then import them:

// 1. define the class in the `assembly/model.ts` file
export class PostedMessage {
  sender: string;
  text: string;
}
// 2. Import the class to your `assembly/main.ts` file
import { PostedMessage } from "./model";
Banner Up

For a quick start in software development from scratch, check out our specialized training courses

Do you need more education, projects, and mentor support in your journey to learn programming? Join Patika+'s intensive 4-8 month bootcamps, gain all the necessary skills with project-based live classes and customized trainings for you, and start your career!

Banner Down

Comments

You need to enroll in the course to be able to comment!