You're trying to achieve two separated things here.
First :
var b=Object.create(a.prototype);
I assume that you're trying to extend a
class in b. Consider modifying directly the b prototype after you created it :
//Create b class
var b = function(){this.key = 2};
//Extends a in b
var b.prototype = new a();
Second :
b.prototype.c1=function(){console.log("function of b");};
b.c1();
You're trying to call your function from your class with b.c1();
. Try to instanciate it first in another variable var bObject = new b();
and then call the function assigned to te prototype : bObject.c1()
Your overall code should look like this :
//Create a class here
var a=function(){this.k="yes";};
//assign b1 function to a class
a.prototype.b1=function(){console.log("function of a");};
//Create b class
var b = function(){this.key = 2};
//extends a in b
b.prototype = new a();
//create c1 function in b class
b.prototype.c1=function(){console.log("function of b");};
//create bObj from b class
var bObj = new b();
//call c1 function defined in b class
bObj.c1();
//can also call b1 function from a class
bObj.b1();