TNW provides the best ICT solutions for your business by the reasonable price.

Recently Developed Websites

1 / 4
amogtech
2 / 4
mhk
3 / 4
apzm
4 / 4
ccg


Example 1

<html>
<head>
<title>JS Constant</title>
</head>
<body>
<p id = "demo"></p>
<script>
const x = (x, y) => x * y;
document.getElementById("demo").innerHTML = x(8, 8);
</script>
</body>
</html>

 

Example 2

<html>
<head>
<title>JS Constant</title>
</head>
<body>
<p id = "demo"></p>
<script>
const x = (x, y, z) => (x + y + z);
document.getElementById("demo").innerHTML = x (4, 5, 6);
</script>
</body>
</html>


Share On:

<html>
<head>
<title>JS Arguments</title>
</head>
<body>
<p id = "demo"></p>
<script>
function jsArgu(){
return arguments.length;
}
document.getElementById("demo").innerHTML = jsArgu(9, 4, 5, 8, 1000);
</script>
</body>
</html>


Share On:

<html>
<head>
<title>Adding and Reducing Function</title>
</head>
<body>
<p id = "demo"></p>
<button type = "button" onclick = "addFun()">+</button>
<button type = "button" onclick = "redFun()">-</button>
<script>
var counter = 0;

var add = (function(){
return function(){
counter += 1;
return counter;
}
})();
function addFun(){
document.getElementById("demo").innerHTML = add();
}

var reduce = (function(){
return function(){
counter -= 1;
return counter;
}
})();
function redFun(){
document.getElementById("demo").innerHTML = reduce();
}
document.getElementById("demo").innerHTML = 0;
</script>
</body>
</html>


Share On:

<html>
<head>
<title>Reducing Function</title>
</head>
<body>
<p id = "demo"></p>
<button type = "button" onclick = "redFun()">-</button>
<script>
var reduce = (function(){
var counter = 10;
return function(){
counter -= 1;
return counter;
}
})();
function redFun(){
document.getElementById("demo").innerHTML = reduce();
}
document.getElementById("demo").innerHTML = 10;
</script>
</body>
</html>


Share On:

<html>
<head>
<title>Adding Function</title>
</head>
<body>
<p id = "demo"></p>
<button type = "button" onclick = "addFun()">+</button>
<script>
var add = (function(){
var counter = 0;
return function(){
counter += 1;
return counter;
}
})();
function addFun(){
document.getElementById("demo").innerHTML = add();
}
document.getElementById("demo").innerHTML = 0;
</script>
</body>
</html>


Share On:

<html>
<head>
<title>Total Result of the Numbers</title>
</head>
<body>
<p id = "demo"></p>
<script>
function findTotal(){
var total = 0;
for(i=0; i<arguments.length; i++){
total += arguments[i];
}
return total;
}
document.getElementById("demo").innerHTML = findTotal(20, 90, 40, 50, 98, 73);
</script>
</body>
</html>


Share On:

<html>
<head>
<title>Finding the Minimum Number</title>
</head>
<body>
<p id = "demo"></p>
<script>
function findMin(){
var min = Infinity;
for(i=0; i<arguments.length; i++){
if(arguments[i]<min){
min = arguments[i];
}
}
return min;
}
document.getElementById("demo").innerHTML = findMin(100, 400, 90, 2, 4000, 500);
</script>
</body>
</html>


Share On: