Suppose I have an object A:
var A = { 'parameter': "Dura lex sed lex.", 'function_a': function (new_type) { console.log ("It's working!"); } }; Then, suppose I also an object B:
var B = { 'parameter': "Veni vidi vici!" }; What I need is a simple way to dynamically create a method function_b() inside the object B without copy/clone the parameter, of the object A, ("Dura lex sed lex.") in the object B and to preserve the parameter ("Veni vidi vici!") of the object B.
How can I do it?
_proto? property.B.function_b = A.function_a;?