JavaScript Class

HTML CODE:

 <html>
  <head>
   <script type="text/javascript" src="classinjs.js">
   </script>
  </head>

  <body>
    This for the class and object example in javascript->
  </body>
</html>

JAVASCRIPT CODE:
class std
{
constructor(fname,lname)
{

this.fristname = fname;//it will call the function variable
this.lastname = lname;
var fullname = fristname + lastname;
alert(fullname);
}



var register = new std('coimbatore','cbe');

SCREENSHOTS:




Comments

Popular posts from this blog

my reframce

Angular UI Grid To Bind JSON Data