Import and Export

Import Export
πŸ‘¨β€πŸ’Ό Our code is getting large. Let's split it into separate modules to keep things organized.
// data.ts
export const book = { title: 'TypeScript Tips', pages: 200 }

// index.ts
import { book } from './data.ts'
🐨 Open
data.ts
and:
  1. Move the user and product objects to data.ts
  2. Export them using named exports
  3. Import them in index.ts

Please set the playground first

Loading "Import and Export"
Loading "Import and Export"