Multiple choice technology programming languages


var personObj = new Object();       
personObj.firstname = "Jerome";         
personObj.lastname = "Davin";       
alert(personObj.firstname);     

  1. Jerome

  2. Davin

  3. error

  4. firstname

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The code creates an object using the Object constructor, assigns firstname='Jerome' and lastname='Davin', then alerts personObj.firstname which outputs 'Jerome'. The alert() function displays the value of the firstname property.