// ARRAY = MATRIZ BIDIMENSIONAL
let numeros: number[] = [1, 2, 3, 4, 5];

let nomes: string[] = ["João", "Ana", "Tiago", "Joaquim"];

// FILTER = RETORNA DADOS DE ACORDO COM A CONDIÇÃO
/*let numeros_pares = numeros.filter(numero => numero % 2 === 0);
console.log(numeros_pares);

let nome_mais_5letras = nomes.filter(nome => nome.length > 5);
console.log(nome_mais_5letras);*/

// SORT = ORDEM CRESCENDE OU DECRESCENTE

numeros.sort((a, b) => a - b); // ordem crescente
console.log(numeros);

numeros.sort((a, b) => b - a); // ordem decrescente
console.log(numeros);




Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: