0% found this document useful (0 votes)
978 views1 page

Property and Method Definitions: Function

This document discusses JavaScript object creation and data types. It describes how to create objects using constructor functions and the Object.create method. It also lists the 7 primitive data types in JavaScript - Boolean, Null, Undefined, Number, BigInt, String, and Symbol - as well as the Object type.

Uploaded by

Nitin Gite
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
978 views1 page

Property and Method Definitions: Function

This document discusses JavaScript object creation and data types. It describes how to create objects using constructor functions and the Object.create method. It also lists the 7 primitive data types in JavaScript - Boolean, Null, Undefined, Number, BigInt, String, and Symbol - as well as the Object type.

Uploaded by

Nitin Gite
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Object creation

function Person(first, last, age, gender, interests) {

// property and method definitions


this.first = first;
this.last = last;
//...
}

const person1 = new Person('Bob');


const person2 = Object.create(person1);

person.prototype.fullName = 'Bob Smith';

data type:

primitive : has 7 type

object

The latest ECMAScript standard defines eight data types:

 Seven data types that are primitives:


o Boolean. true and false.
o null. A special keyword denoting a null value. Because JavaScript is case-
sensitive, null is not the same as Null, NULL, or any other variant.
o undefined. A top-level property whose value is not defined.
o Number. An integer or floating point number. For example: 42 or 3.14159.
o BigInt. An integer with arbitrary precision. For example: 9007199254740992n.
o String. A sequence of characters that represent a text value. For example: "Howdy"
o Symbol (new in ECMAScript 2015). A data type whose instances are unique and
immutable.
 and Object

You might also like