Click in order · JavaScript and TypeScript course · Module 2: Functions, Arrays and Objects

Object Basics - Creating with Literals

Arrange the elements of creating a dinosaur object with a method:

Items to click

  • name: 'Rex',
  • roar() { return 'ROAR!'; }
  • };
  • const dino = {
Show the answer

Correct order:

  1. const dino = {
  2. name: 'Rex',
  3. roar() { return 'ROAR!'; }
  4. };