Sabrás
- Write JavaScript variables, constants, and data types to store and manipulate values
- Use conditionals, loops, and functions to control program flow and reuse logic
- Work with arrays and objects to organize related data
- Run and debug JavaScript code in the browser console and in a simple HTML page
Conviene saber antes
- Basic comfort using a computer and a text editor
- A general understanding of what a web page is
Temario
9 lecciones y un proyecto final
- 1
Course setup and running your first JavaScript Gratis
You learn where JavaScript runs (inside browsers, through a JavaScript engine) and how the JavaScript version history shapes what you will learn. You then open the browser's developer console and run your first line of JavaScript.
3 pasos de construcción3 ejercicios3 preguntas - 2
Declaring variables and constants Beyond Pass
You will learn what a variable is and how to declare one with let, and how a constant with const differs. You will also see how a value is stored and reused in JavaScript code.
1 de código4 pasos de construcción3 ejercicios3 preguntas - 3
Tu primer código en JavaScript: console.log y la etiqueta script Beyond Pass
Aprenderás a ejecutar JavaScript dentro de una página HTML, a imprimir un mensaje en la consola del navegador con console.log y a mover el código a su propio archivo index.js enlazado mediante una etiqueta script. El capítulo presenta la configuración básica que necesitas antes de aprender los tipos primitivos y los operadores.
3 de código5 pasos de construcción2 ejercicios3 preguntas - 4
Trabajar con cadenas y literales de plantilla Beyond Pass
Aprenderás qué es una cadena en JavaScript y cómo escribir texto con comillas. También aprenderás los literales de plantilla, que te permiten insertar valores dentro del texto usando comillas invertidas y ${...}.
2 de código2 pasos de construcción3 ejercicios3 preguntas - 5
Nombres de variables y la diferencia entre const y let Beyond Pass
En esta lección verás las reglas para nombrar variables en JavaScript: qué está permitido, qué está prohibido y por qué los nombres distinguen mayúsculas de minúsculas. También verás la diferencia entre let (se puede reasignar) y const (no se puede reasignar), con un error que verás al intentarlo.
2 de código3 pasos de construcción1 ejercicio3 preguntas - 6
Repetir código con bucles Beyond Pass
Esta lección trata la diferencia entre tipos primitivos (de valor) y tipos por referencia en JavaScript, y cómo las variables guardan valores de estos tipos. También muestra cómo el tipado dinámico de JavaScript permite que una variable cambie el tipo de valor que guarda.
2 de código3 pasos de construcción2 ejercicios3 preguntas - 7
Escribir y llamar funciones Beyond Pass
Esta lección trata los objetos como una forma de agrupar valores relacionados, y cómo leer y cambiar sus propiedades con la notación de punto y de corchetes. El capítulo del vídeo se titula "Escribir y llamar funciones", pero la transcripción y los fotogramas de este segmento solo muestran objetos, así que esta lección cubre lo que realmente aparece.
2 de código3 pasos de construcción2 ejercicios3 preguntas - 8
Almacenar datos en arrays y objetos Beyond Pass
Esta lección muestra cómo un array de JavaScript guarda una lista de valores en una sola variable, cómo leer y cambiar los elementos por su índice, y cómo comprobar el tipo de un valor con typeof. También explica por qué un array es un objeto, y qué pasa si metes en él un valor del tipo equivocado.
3 de código4 pasos de construcción3 ejercicios3 preguntas - 9
[51] Functions with Parameters, Return Values and a Small Project Beyond Pass
[52] This lesson shows how to write functions that take inputs (parameters) and give back results (return values), and how to use them to build a small project. You will see the difference between a function that performs a task and one that calculates a value.
1 de código1 fórmula4 pasos de construcción2 ejercicios3 preguntas
Proyecto final
Carrito de la compra en consola: un pequeño proyecto de JavaScript
Crea un programa pequeño de carrito de la compra que se ejecute desde una página HTML e imprima un recibo en la consola del navegador. Usa variables, constantes, plantillas literales, arrays, objetos, un bucle y funciones con valores de retorno. Escribe un único programa más grande en lugar de muchos fragmentos separados.
Sus 8 tareas se abren con Beyond Pass.
Vista previa gratis · La lección 1 completa
Course setup and running your first JavaScript
You learn where JavaScript runs (inside browsers, through a JavaScript engine) and how the JavaScript version history shapes what you will learn. You then open the browser's developer console and run your first line of JavaScript.
Escribe los comandos de la lección, rompe cosas y descubre por qué.
Dibuja y escribe junto al vídeo.
La idea
JavaScript is the programming language of the web. Every modern browser, such as Chrome or Firefox, can run JavaScript code. Inside each browser there is a piece of software called a JavaScript engine that reads your code and carries out its instructions. Firefox uses an engine called SpiderMonkey, and Chrome uses one called V8.
JavaScript was first released in 1997 as version 1, and it has grown since then. A major update came in 2015, called ES2015 or ES6, and newer yearly versions followed in 2016 and after. The language you learn in this course is the modern version, so the features you use will work in current browsers.
You do not need to install anything to start. Open your browser, press F12 (or right-click the page and choose Inspect, then the Console tab) to open the developer tools. The Console is a box where you type JavaScript and press Enter, and the browser runs it immediately. Whatever your code produces is shown right below what you typed.
Your first program can be a single line. Type the line in the console and press Enter. If the browser shows the result below your line, you have just run JavaScript. This is the fastest way to test an idea, and it is the first tool you will use throughout the course.
Puntos clave
- JavaScript runs inside the browser, using the browser's JavaScript engine (SpiderMonkey in Firefox, V8 in Chrome). 2:00
- JavaScript started in 1997 as version 1; the ES2015/ES6 update and yearly releases after it added the modern features you will learn. 3:00
- The browser's developer console lets you run JavaScript with no installation: open it, type a line, and press Enter. 3:50
Construye a la vez en la terminal de práctica
- Open a new browser tab (Chrome or Firefox). Open the developer tools with F12, or with right-click then Inspect. 3:50Deberías ver: A panel opens at the bottom of the page with tabs such as Elements, Console and Sources.
- Click the Console tab. You should see a prompt symbol (>) where you can type. 3:50Deberías ver: The Console tab is selected and a blinking cursor waits after the > symbol.
- Click next to the > symbol and type a simple line, for example: 2 + 3 , then press Enter. Deberías ver: The console prints 5 below your line, showing the browser ran your JavaScript.
$ 2 + 3 5
Práctica
In the console you type 7 * 6 and press Enter. What number does the console print? Give the number only.
Pista
Multiply 7 by 6.
Solución
- Multiplication is done first: 7 times 6 equals 42.
- The console prints the result of the expression.
42
In your own words, explain what the JavaScript engine does and why different browsers have different engines.
Solución
- The engine is the part of the browser that reads JavaScript code and runs it.
- Each browser company builds its own engine (Firefox uses SpiderMonkey, Chrome uses V8), so the code is run by different software that follows the same language rules.
The JavaScript engine is the part of the browser that reads and runs JavaScript. Firefox uses SpiderMonkey and Chrome uses V8, so each browser has its own engine that runs the same language.
Open the Console in your browser, type 10 - 4 and press Enter. Then type a line of your own choice and check that the console answers it.
Solución
- Press F12 and open the Console tab.
- Type 10 - 4 and press Enter; the console prints 6.
- Type any other simple sum and check the printed result.
The console prints 6 for 10 - 4, and your own line also prints a result.
En tu bloc de notas
Draw a box for the browser, put a small circle inside it labelled JavaScript Engine, and draw an arrow from the code to the engine. Write Chrome: V8 and Firefox: SpiderMonkey beside it.
Test
Which part of the browser actually reads and runs JavaScript code?
- The address bar
- The JavaScript engine
- The bookmarks bar
- The tab title
Mostrar la respuesta
B. The JavaScript engine · Each browser contains a JavaScript engine, such as SpiderMonkey in Firefox or V8 in Chrome, which runs the code.
2:00 ver el momentoIn which year was JavaScript first released as version 1?
- 1995
- 1997
- 2015
- 2016
Mostrar la respuesta
B. 1997 · JavaScript v1 is shown on the timeline at 1997. The 2015 ES2015/ES6 update came later.
3:00 ver el momentoWhat is the quickest way to run a line of JavaScript with no installation?
- Install a compiler
- Open the browser's developer console and type the line
- Restart the computer
- Create a new folder
Mostrar la respuesta
B. Open the browser's developer console and type the line · The browser's Console tab runs JavaScript as soon as you press Enter.
3:50 ver el momento
Lecciones 2–9 y el proyecto final
Se abren con Beyond Pass: todas las lecciones de todos los cursos, completas. Un solo pago: 14,99 $ por 90 días o 29 $ por un año. Sin suscripción.
Hecho por Beyond a partir del vídeo «JavaScript Course for Beginners – Your First Step to Web Development» de Programming with Mosh. El vídeo se reproduce en el propio reproductor de YouTube. Míralo en YouTube · Todas las lecciones
