Arrays
How do I make an arrays?
What is a arrays? How do you make a arrays? This script and codes were developed by MoyArt Maximus on 09 July 2022, Saturday.
Arrays - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Arrays</title>
</head>
<body> k <script src="js/index.js"></script>
</body>
</html>
Arrays - Script Codes JS Codes
//Las listas dentro de JS se llaman Arrays
var todos = ["item 1", "item 2", "item 3"];
//Si queremos agregar un nuevo elemento al final de la lista, utilizamos el metodo push()
todos.push("item 4");
console.log(todos);
//Para cambiar el valor de un elemento de mi lista unicamente hay que apuntar
//al elemento que queremos cambiar y asignarle un nuevo valor
todos[0] = "item 1 actualizado";
console.log(todos);
//Para borrar el ultimo elemento de la lista, utilizamos el metodo pop()
todos.pop()
console.log(todos);
//Otra forma de borrar es mediante Splice, este metodo acepta dos parametros, el primero es el
//indice desde donde quieres borrar tu lista, y el segundo es, cuantos elementos quiero borrar
todos.splice(2,1);
//en el ejemplo anterior le dije que queria borrar a partir del tercer elemento (item 3)
//y que solo quiero borrar un elemento (item 3)
console.log(todos);
![Arrays - Script Codes](http://shots.codepen.io/MoyArt/pen/QpbxGr-512.jpg)
Developer | MoyArt Maximus |
Username | MoyArt |
Uploaded | July 09, 2022 |
Rating | 3 |
Size | 1,702 Kb |
Views | 54,648 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Chat Fake | 3,488 Kb |
AJAX basics | 1,828 Kb |
Spoiler Revealer | 2,023 Kb |
Portafolio | 2,128 Kb |
Ejercicio Polymer | 1,566 Kb |
Propiedades comunes Css | 1,697 Kb |
Jquery AJAX Methods | 2,957 Kb |
Material Design Cards | 2,402 Kb |
ManejoDeVistas | 3,553 Kb |
A Pen by MoyArt Maximus | 1,450 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Expert Help | SinceSidSlid | 4,064 Kb |
Dice | Fraina | 5,026 Kb |
A Pen by Alex Bergin | Abergin | 3,347 Kb |
Polygon Logo in CSS | Kai | 3,412 Kb |
Drop Cap | Gsaiki | 1,571 Kb |
Gradients | Karpovsystems | 2,394 Kb |
Loading animation | Codeams | 2,408 Kb |
Wikipedia Viewer | Thomasvaeth | 2,549 Kb |
A Pen by Dalton Liu | Liudalton | 12,437 Kb |
A Pen by Kenny Mark | Kennymark | 5,574 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!