You are developing an application in HTML5.
You have the following code.
You need to add an additional property to the function definition.
Which line of code should you use?

A.
NewOrder [“newProperty”] = “newProperty”
B.
NewOrder. prototype. newProperty = “newProperty”
C.
this.NewOrder. newProperty = “newProperty”
D.
NewOrder. newProperty = “newProperty”
Explanation:
http://www.w3schools.com/js/js_object_prototypes.asp
i really this the right answer is B
can anyone tell me if i am right and if not why?
3
0
asdf is right answer should be B.
2
0
I think the answer is D. To add an additional property to a function object, just use the object.property = “property name”.
https://www.w3schools.com/js/js_object_prototypes.asp
0
3
The correct answer is B
0
0
why not d?
0
0
As I understood – NewOrder is an object prototype, not existing object. If new object would be created (var myOrder = new NewOrder(1,01-01-2017 10:15); ) and that object needs new property, then yes – answer would be D.
0
0
B
1
0
New questions from September 2017 incoming, about 50 are new ones:
http://optimumfiles.com/ProgrammingInHTML
0
4
B is the answer.
0
0
I mean that the question is not clear. We can use prototype and normal object extension.
If we use prototype the additional property is permanent, also for future object instances.
If we use normal extensions the additional property is only for that object.
0
0
yes, it’s b or d.
B is more correct.
0
0
C is wrong for sure!
0
0