Skip to content

Instantly share code, notes, and snippets.

@victor123
Created September 25, 2017 16:35
Show Gist options
  • Save victor123/9b18f0aabdfa44b349d61ef14966e4fe to your computer and use it in GitHub Desktop.
Save victor123/9b18f0aabdfa44b349d61ef14966e4fe to your computer and use it in GitHub Desktop.
JS Bin // source http://jsbin.com/qivowar
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<p id="name"> </p>
<p id="comp"> </p>
<p id="sal"> </p>
<script id="jsbin-javascript">
function emp (name,company,salary ) {
this.name = name;
this.company = company;
this.salary = salary || 1000
this.increaseSal = function() {
return this.salary + 6000
}
}
var emp1 = new emp ("victor","SVN",2000);
document.getElementById("name").innerHTML = emp1.name;
document.getElementById("comp").innerHTML = emp1.company;
document.getElementById("sal").innerHTML = emp1.increaseSal();
</script>
<script id="jsbin-source-javascript" type="text/javascript">
function emp (name,company,salary ) {
this.name = name;
this.company = company;
this.salary = salary || 1000
this.increaseSal = function() {
return this.salary + 6000
}
}
var emp1 = new emp ("victor","SVN",2000);
document.getElementById("name").innerHTML = emp1.name;
document.getElementById("comp").innerHTML = emp1.company;
document.getElementById("sal").innerHTML = emp1.increaseSal();</script></body>
</html>
function emp (name,company,salary ) {
this.name = name;
this.company = company;
this.salary = salary || 1000
this.increaseSal = function() {
return this.salary + 6000
}
}
var emp1 = new emp ("victor","SVN",2000);
document.getElementById("name").innerHTML = emp1.name;
document.getElementById("comp").innerHTML = emp1.company;
document.getElementById("sal").innerHTML = emp1.increaseSal();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment