function within a function in JS

function within a function in JS 👈

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Some and Every methods in array</title>






</head>
<body>
<script>


function total(){
this.sum= function(a,b) { return a+b ;}
this.multiply= function(a,b) { return a*b ;}
this.divide= function(a,b) { return a/b ;}
}


var all = new total();
console.log(all.multiply(10,12));
console.log(all.sum(10,12));
console.log(all.divide(10,12));




</script>
</body>
</html>


Comments

Popular posts from this blog