The most viewed posts

Registry Reviver

Web Development Services

Contact Me

How to clean up Windows Computer

About Desktop Icons in Windows Computer

Driver Booster

CCleaner

How to make a computer secure and run faster

Computer Repair and Maintenance Service

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 Sep 22 2020, 15:42:46

includes (JavaScript Array Method)

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

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

function tnwFun2(){
document.getElementById("demo").innerHTML = tnwNames.includes("Mya Mya");
}

ZilaStar ICT Sep 05 2020, 09:58:52

from (JavaScript Array Method)

const myLetter = "ABCDEFGHIJKL";

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

function tnwFun2(){
const result = Array.from(myLetter);
document.getElementById("demo").innerHTML = result;
}

ZilaStar ICT Aug 26 2020, 09:58:18

forEach (JavaScript Array Method)

const student = ["Aung Aung", "Maung", "Kyaw", "Zaw", "Soe", "Moe"];
let names = "";
function tnwFun1(){
student.forEach(tnwFun2);
}

function tnwFun2(item, index){
names += index + " : " + item + "
";
document.getElementById("demo").innerHTML = names;
}

ZilaStar ICT Aug 11 2020, 09:57:48

findIndex (JavaScript Array Method)

const tnwAges = [19, 39, 28, 43, 29, 45, 53];

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

function tnwFun2(){
document.getElementById("demo").innerHTML = tnwAges.findIndex(chkAge);
}
function chkAge(age){
return age > document.getElementById("myAge").value;
}

ZilaStar ICT Jul 27 2020, 09:57:10

find (JavaScript Array Method)

const tnwAges = [19, 39, 28, 43, 29, 45, 53];

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

function tnwFun2(){
document.getElementById("demo").innerHTML = tnwAges.find(chkAge);
}

function chkAge(age){
return age > document.getElementById("myAge").value;
}

ZilaStar ICT Jul 11 2020, 09:56:23

filter (JavaScript Array Method)

const tnwAges = [25, 18, 29, 20, 40, 32, 53, 24];

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

function tnwFun2(){
const result = tnwAges.filter(chkAge);
document.getElementById("demo").innerHTML = result.join("
");
}

function chkAge(age){
return age > 20;
}

ZilaStar ICT Jun 22 2020, 09:55:54

fill (JavaScript Array Method)

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

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

function tnwFun2(){
const result = tnwNames.fill("Aung Aung", 1, 3);
document.getElementById("demo").innerHTML = result.join("
");
}

ZilaStar ICT Jun 11 2020, 09:55:16

every (JavaScript Array Method)

const tnwAge = [20, 29, 48, 76, 50, 38, 39];

function tnwFun1(){
document.getElementById("demo").innerHTML = tnwAge.every(tnwFun2);
}

function tnwFun2(chkAge){
return chkAge > 19;
}

ZilaStar ICT Apr 03 2020, 09:53:28

entries (JavaScript Array Method)

const tnwNames = ["Hla Hla", "Mya Mya", "Aye Aye", "Nwe Nwe", "Soe Soe", "Moe Moe", "Aung Aung"];
const y = tnwNames.entries();
for(x of y){
document.write(x + "
");
}

ZilaStar ICT Mar 11 2020, 09:51:51

copyWithin (JavaScript Array Method)

const people = ["Hla", "Mya", "Aung", "Maung", "Soe", "Noe", "Moe"];

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

function tnwFun2(){
const result = people.copyWithin(3, 0, 3);
document.getElementById("demo").innerHTML = result.join("
");
}

ZilaStar ICT Mar 01 2020, 09:48:09

concat (JavaScript Array Methods)

const girls = ["Aye Aye", "Nwe Nwe", "Htwe Htwe"];
const boys = ["Aung Aung", "Maung Maung", "Kyaw Kyaw"];
const students = ["Hla Hla", "Mya Mya", "Aung Ba", "Aung Mya"];

const people = girls.concat(boys, students);
document.write(people.join("
"));

ZilaStar ICT Feb 25 2020, 09:47:07

JavaScript Array Properties

length
Sets or returns the number of elements in an array.

prototype
Allows you to add new properties and methods to an Array object.


//length
/*
const countries = ["USA", "UK", "Canada", "Myanmar", "Singapore"];

function showLength(){
document.getElementById("demo").innerHTML = countries.length;
}

//prototype

Array.prototype.tnwCase = function(){
for(let i = 0; i < this.length; i++){
this[i] = this[i].toLowerCase(); //lower case
}
};

const countries = ["USA", "UK", "Canada", "Myanmar", "Singapore"];
countries.tnwCase();

function tnwFun(){
document.getElementById("demo").innerHTML = countries;
}*/

//Another example of prototype property

function Person(first, middle, last){
this.firstName = first;
this.middleName = middle;
this.lastName = last;
}

const myFriend = new Person("Aung", "Kyaw", "Soe");
Person.prototype.nationality = "Myanmar";
Person.prototype.age = 35;

function tnwFun(){
document.getElementById("demo").innerHTML = myFriend.age;
}

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