Practicas01_JavaScript
// Numbers:
let length = 16;
let weight = 7.5;
// Strings:
let color = "Yellow";
let lastName = "Johnson";
// Booleans
let x = true;
let y = false;
// Object:
const person = {firstName:"John", lastName:"Doe"};
// Array object:
const cars = ["Saab", "Volvo", "BMW"];
// Date object:
const date = new Date("2022-03-25");
Asersiones
Como eliminar todos los elementos de un arreglo: Hay dos maneras de
hacerlo.
let miArray = [1, 2, 3, 4, 5];
// Opción 1: Usando length
[Link] = 0;
[Link](miArray); // Output: []
// Opción 2: Usando splice()
miArray = [1, 2, 3, 4, 5]; // Reiniciar el arreglo
[Link](0, [Link]);
[Link](miArray); // Output: []
Obtener los valores de las propiedades de un objeto como un arreglo: