I'm new to Prototypal inheritance and I've been stuck in an easy task
I have something like this:
var test1 = {
clear : function () {
alert('hey');
}
}
var test2 = {
varB : 2
}
I would like to test2 extend from test1. Can anyone give me a direction? Should I still use Object.create, or maybe a function + call method? Im a bit confused here.
Every example that i found are based on extending and then setting attributes, methods, etc.. But my object is already declared here.
Thanks!