Skip to main content

Posts

Showing posts with the label Typescript Array unshift

Typescript Array ,Typescript Array Declaration,Typescript Array foreach,Typescript Array Concat ,Pop, Push

TypeScript Type Test Part 2 Working with Array Like javascript type script allows to work with an array of values
Declaration
 Two Type of Declaration  //With Element Type
 MostSpokenLangs: string[] = [' Mandarin Chinese','English','Hindustani ', 'Spanish','Arabic','Malay','Russian','Bengali','Portuguese','French']; //generic Type
 MostSpokenLangs: Array<string> = [' Mandarin Chinese','English','Hindustani ', 'Spanish','Arabic','Malay','Russian','Bengali','Portuguese','French']; Length to find the length of the array
arrayname.length ElementAccess  to  access  a element in a array
arrayname[elementindex]= value 
foreach()  for each element in the array foreachaccess() {
  this.myarrayoutput.foreachaccess ='';
  this.MostSpokenLangs.forEach(el => {
    this.myarrayoutput.foreachaccess=  this.myarrayoutput.forea…