0

Cant understand objects

Objects

23rd Jun 2017, 4:48 PM
Badhusha
Badhusha - avatar
3 Antworten
0
An object in programmation is the same that an object in real life. For exemple, a computer in an object and it has attributes, like the size of the screen, the color, ... and a computer also have methods, like when it opens when you turn it on or when a letter is printed when you press it... So, an object in programmation has attributes and methods, attributes are the variables and methods are the functions.
23rd Jun 2017, 4:54 PM
clement
clement - avatar
0
//function function person (name, age) { this.name = name; this.age = age; } // this goes to the function //person(name,age) var John = new person("John", 25); var James = new person("James", 21); //here we need var john age so it take just the age from function for the var john document.write(John.age); //output 25 cz john have age 25
23rd Jun 2017, 4:58 PM
Elie Douaihy
Elie Douaihy - avatar
0
now programming what do you know about an object. "a material thing that can be seen and touched". In programimg object a variable. you put data or attributes on it.
23rd Jun 2017, 5:11 PM
AL Emran
AL Emran - avatar