Javascript Objects
How do I make an javascript objects?
What is a javascript objects? How do you make a javascript objects? This script and codes were developed by Andy on 22 November 2022, Tuesday.
Javascript Objects - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Javascript Objects</title>
</head>
<body> <script src="js/index.js"></script>
</body>
</html>
Javascript Objects - Script Codes JS Codes
// function person(name, age, color) {
// this.name = name;
// this.age = age;
// this.favColor = color;
// }
// var p1 = new person("Dog", 38, "yellow");
// var p2 = new person("Peggo", 39, "Black");
// document.write(p1.age); // Outputs 38
// document.write(p2.name); // Outputs "Peggo"
// Methods!!
// function person(name, age) {
// this.name = name;
// this.age = age;
// this.changeName = function (name) {
// this.name = name;
// }
// }
// var p = new person("David", 21);
// p.changeName("John");
//Now p.name equals to "John"
function person(name, age) { this.name= name; this.age = age; this.yearOfBirth = bornYear;
}
function bornYear() { return 2016 - this.age;
}
var p = new person("Andy", 38);
document.write(p.yearOfBirth());
// Outputs 1978
Developer | Andy |
Username | adriver |
Uploaded | November 22, 2022 |
Rating | 3 |
Size | 1,605 Kb |
Views | 10,120 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
View pdf | 1,753 Kb |
Chart Club | 2,701 Kb |
Loupes etc page | 2,829 Kb |
Contact Form | 2,123 Kb |
News article grid | 2,511 Kb |
Javascript Functions | 1,688 Kb |
A Pen by Andy | 2,188 Kb |
Javascript Tutorial 1 | 1,680 Kb |
Pop-up ratings modal | 3,501 Kb |
Angular App 1 | 1,459 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Loader | MikitaLisavets | 3,321 Kb |
CSS Heart Loaders | Nourabusoud | 2,161 Kb |
HEXAGON | Aurumlux | 1,684 Kb |
SVG Circle Progress | JMChristensen | 3,368 Kb |
A Pen by Rob Levin | Roblevin | 2,787 Kb |
LBCA - Mail canvas | Emnbdx | 3,856 Kb |
SCSS Social Icons Flat | Mattsince87 | 3,482 Kb |
Css color for svg | Ademilter | 2,392 Kb |
Light Switch | Bartuc | 4,933 Kb |
Improved Page Flipping Effect | Usaphp | 5,201 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!