Properties


#1

hey guys,

ive compared this code to others but i cant see what is missing. i get the message : "Oops, try again. It looks like you have an error in your code. Here's the message: TypeError: snoopy.age is not a constructor "

var snoopy = new Object();
snoopy.species = "beagle";
snoopy.age = 10;

// save Snoopy's age and species into variables
// use dot notation for snoopy's species
var species = snoopy.species;
var age = snoopy.age;

// use bracket notation for snoopy's age
var age = new snoopy["age"];


#2

var age = new snoopy["age"]; //TypeError: snoopy.age is not a constructor

remove new


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.