The most viewed posts

Registry Reviver

Web Development Services

Contact Me

How to clean up Windows Computer

About Desktop Icons in Windows Computer

Computer Repair and Maintenance Service

Driver Booster

CCleaner

How to make a computer secure and run faster

Myanmar font and keyboard for Windows

The most viewed items

Dell Inspiron 5559

Desktop Hard Disk

Laptop RAM

SONY Playstation Portable

HP ProBook 430

External Hard Disk

Laptop

Please login to start chat

ZilaStar ICT Dec 06 2021, 19:52:03

Looping Array Element (JS Arrays)

<!DOCTYPE html>
<html>
<head>
<title>JavaScript Code Testing</title>
</head>
<body>
<p id = "demo"></p>
<script>
var cities, clen, text, i;
cities = ["Yangon", "Mandalay", "Naypyidaw", "Meikhtila"];
clen = cities.length;
text = "<ul>";
for(i=0; i<clen; i++){
text += "<li>" + cities[i] + "</li>";
}
text += "</ul>";
document.getElementById("demo").innerHTML = text;
</script>
</body>
</html>

...Read more
ZilaStar ICT Nov 16 2021, 19:51:24

Foreach Loop (JS Arrays)

<!DOCTYPE html>
<html>
<head>
<title>JavaScript Code Testing</title>
</head>
<body>
<p id = "demo">forEach Loop</p>
<script>
var cities, text;
cities = ["Yangon", "Mandalay", "Naypyidaw", "Meikhtila"];

text = "<ul>";
cities.forEach(jsFunction);
text+= "</ul>";

function jsFunction(value){
text += "<li>" + value + "</li>";
}

document.getElementById("demo").innerHTML = text;

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

...Read more
ZilaStar ICT Oct 30 2021, 19:50:56

Creating the Array (JS Arrays)

<!DOCTYPE html>
<html>
<head>
<title>JavaScript Code Testing</title>
</head>
<body>
<p id = "demo1"></p>
<p id = "demo2"></p>
<script>

//good habit in crating array
var a = ["aaa", "bbb", "ccc", "ddd"];
document.getElementById("demo1").innerHTML = a;

//bad habit in creating array
var b = new Array("aaa", "bbb", "ccc", "ddd");
document.getElementById("demo2").innerHTML = b;
</script>
</body>
</html>

...Read more
ZilaStar ICT Oct 13 2021, 19:50:22

Array Elements (JS Arrays)

<!DOCTYPE html>
<html>
<head>
<title>JavaScript Code Testing</title>
</head>
<body>
<p id = "demo1"></p>
<p id = "demo2"></p>
<script>

var a = ["aaa", "bbb", "ccc", "ddd"];
a[0] = "eee";
document.getElementById("demo1").innerHTML = a;


var b = new Array("aaa", "bbb", "ccc", "ddd");
document.getElementById("demo2").innerHTML = b[2];
</script>
</body>
</html>

...Read more
ZilaStar ICT Sep 29 2021, 19:49:31

Adding Array Element (JS Arrays)

<!DOCTYPE html>
<html>
<head>
<title>JavaScript Code Testing</title>
</head>
<body>
<p id = "demo">forEach Loop</p>
<script>
var cities, text;
cities = ["Yangon", "Mandalay", "Naypyidaw", "Meikhtila"];

text = "<ul>";
cities.forEach(jsFunction);
text+= "</ul>";

function jsFunction(value){
text += "<li>" + value + "</li>";
}

document.getElementById("demo").innerHTML = text;

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

...Read more
ZilaStar ICT Sep 05 2021, 19:48:42

unshift (JavaScript Array Method)

const tnwNames = ["Moe", "Soe", "Noe", "Mya"];
function tnwFun1(){
document.getElementById("demo").innerHTML = tnwNames.join(", ");
}

function tnwFun2(){
document.getElementById("demo").innerHTML = "The original array is : " + tnwNames.join(", ");
let tnwNewvalue = document.getElementById("newname").value;
tnwNames.unshift(tnwNewvalue);
document.getElementById("demo1").innerHTML = "The new array is : " + tnwNames.join(", ");
}

To see demo

...Read more
ZilaStar ICT Aug 19 2021, 19:47:15

splice (JavaScript Array Method)

const tnwNames = ["Hla", "Mya", "Soe", "Moe", "Noe"];

function tnwFun1(){
document.getElementById("demo").innerHTML = tnwNames.join(", ");
}

function tnwFun2(){
document.getElementById("demo").innerHTML = "The original array is :
" + tnwNames.join(", ");
let result = tnwNames.splice(2, 2, "Aung", "Kyaw", "Tun");
document.getElementById("demo1").innerHTML = "The removed elements are :
" + result.join(", ");
document.getElementById("demo2").innerHTML = "The new array is :
" + tnwNames.join(", ");
}

...Read more
ZilaStar ICT Jul 24 2021, 19:46:34

sort (JavaScript Array Method)

//1. sort alphabetically
/**
const countries = ["Myanmar", "Singapore", "Malaysia", "USA", "Thailand", "Vietname"];

function tnwFun1(){
document.getElementById("demo").innerHTML = countries.join("
");
}

function jsSort(){
let result = countries.sort();
document.getElementById("demo").innerHTML = result.join("
");
}

function jsReverse(){
let result = countries.reverse();
document.getElementById("demo").innerHTML = result.join("
");
}

//2. Sort randomly

const tnwNums = [20, 17, 30, 38, 40, 50, 28, 12];

function tnwFun1(){
document.getElementById("demo").innerHTML = tnwNums.join("
");
}

function tnwFun2(){
let result = tnwNums.sort(tnwFun3);
document.getElementById("demo").innerHTML = result.join("
");
}

function tnwFun3(a, b){
return 0.5 - Math.random();
} */

// 3. Sort Numerically

const tnwNums = [20, 17, 30, 38, 40, 50, 28, 12, 4];

function tnwFun1(){
document.getElementById("demo").innerHTML = tnwNums.join("
");
}

function jsSort(){
let result = tnwNums.sort(function(a, b){return a - b;});
document.getElementById("demo").innerHTML = result.join("
");
}

function jsReverse(){
let result = tnwNums.sort(function(a, b){return b - a;});
document.getElementById("demo").innerHTML = result.join("
");
}

...Read more
ZilaStar ICT Jul 03 2021, 19:46:00

some (JavaScript Array Method)

const tnwNums = [20, 39, 48, 58, 68, 70, 85, 90];

function tnwFun1(){
document.getElementById("demo").innerHTML = tnwNums.join(", ");
}

function tnwFun2(){
let result = tnwNums.some(tnwFun3);
document.getElementById("demo").innerHTML = tnwNums.join(", ");
document.getElementById("demo1").innerHTML = result;
}

function tnwFun3(num){
let chkInput = document.getElementById("chknum").value;
return num > chkInput;
}

...Read more
ZilaStar ICT Jun 13 2021, 19:45:18

slice (JavaScript Array Method)

const tnwNums = [20, 29, 30, 39, 40, 47, 50, 70];

function tnwFun1(){
document.getElementById("demo").innerHTML = tnwNums.join(", ");
}

function tnwFun2(){
let result = tnwNums.slice(1, 4);
document.getElementById("demo").innerHTML = "The original is: " + tnwNums.join(", ");
document.getElementById("demo1").innerHTML = "The new array is: " + result.join(", ");
}

...Read more
ZilaStar ICT May 29 2021, 19:44:28

shift (JavaScript Array Method)

const tnwNums = [20, 30, 40, 50, 60, 70, 90];

function tnwFun1(){
document.getElementById("demo").innerHTML = tnwNums.join(", ");
}

function tnwFun2(){
let result = tnwNums.shift();
document.getElementById("demo").innerHTML = tnwNums.join(", ");
document.getElementById("demo1").innerHTML = "The removed element is: " + result;
}

...Read more
ZilaStar ICT May 07 2021, 15:50:24

reverse (JavaScript Array Method)

const tnwNums = [20, 30, 40, 50, 60, 70];

function tnwFun1(){
document.getElementById("demo").innerHTML = tnwNums.join("
");
}

function tnwFun2(){
let result = tnwNums.reverse();
document.getElementById("demo").innerHTML = result.join("
");
}

Page : 8 of 30
To Contact
Available Services
Terms and Conditions