One of popular
language programming is JavaScript. Be careful and do not be confused between
Java and JavaScript. For your information, this language is the object oriented
which is a little bit difficult to understand for beginners. What is an object? To know more about JavaScript
and its whereabouts, you can read the following sections.
Creating Object in JavaScript
1. Object
In JavaScript,
programmer should understand reference data types
and Primitive Data Types. Both will be included in how data and object
related. Data can be object-based because it is identified in code. Reference
means object or data that has properties from others. On contrary, primitive
data purely comes from defining in code.
Object is essential
in JavaScript and creating objects is
interesting task. Object in programing is similar to the real life. For
example, you will see tangible object named car. What do you have in mind when
people ask about car? It has tire, wheel, steering, windshield, engine, etc. To
understand object, you can describe it based on shape, form, and
characteristic. The car also has capability to carry passenger, bigger than
bike, and any task-oriented character. From this point, you understand the car
properties.
Using the practical patterns for object create is the
easiest thing. Object can be a method or anything as long as it has properties.
Object in practical pattern does not have to be in complex code. Pattern
resemble object will behave based on its characteristics and properties.
Programmer only puts necessity things to be properties of object.
2. Properties
Object
properties have attributes from simple to
complex types. As explained above, object can be defined through properties.
You will understand how one object reacts when going through its properties.
For this matter, it is called attributes. Attributes from one object to other
depend on the purpose of object itself.
One interesting thing
in JavaScript is inherited property. If you
are beginner in this language, this concept is similar to the real life
condition. For example, you can get house from parent. One object can be passed
through the different properties. As you know, properties are attributes that
stay on object. Properties will work in the right object, so they are still in
idle state because they cannot get proper object. In this situation, properties
will go into another object.
3. Prototype
Object's
Prototype Attribute and Prototype Property are terms that commonly found in JavaScript. Prototype is like modeling
which consists of many objects and properties. In prototype, you will find
chain that connects one object to other then follow with properties. As stated
above, properties will find rightfully object and walk through chain. Object is
able to demote attribute then develop into another object.
Serialize
and Deserialize Objects are part or
prototype. Programmer needs time to create object with its properties. However,
object also requires utmost intention serialize. It means the object can be
embedded with different properties at the same time. On contrary, deserialize
will work the opposite way.
Application of
JavaScript is not standalone program. You need to integrate with HTML to use
JavaScript. For further reading, some
resources are available via online or online. JavaScript has been going through
much development to suit with recent technology. It is better to read basic
concept then move into the latest level of JavaScript.
0 komentar:
Posting Komentar