ImC4k / JS-Object-english-2019-10-11-10-3-8-880

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JS-Object

  1. Program and observe the following requirements:
  • Create a null object and set its variable name as user;
  • Add a name attribute and set its value as John;
  • Add a surname attribute and set its value as Mike;
  • Modify the value of name attribute as Peter;
  • Delete name attribute of user.
  1. Program and observe the following requirements: calculate how many pieces of fruit there are in the fruit object and the output should be 50.
var fruit = {
apple: 20,
pear: 20,
peach: 10
};
// write your code here...

Requirements

Create a js document and complete the above requirements.

About


Languages

Language:JavaScript 100.0%