JavaScript Syntax Basics
Syntax is the set of rules that defines how JavaScript code must be written. Following these rules allows the browser or Node.js to understand and execute your code correctly.
This lesson covers the essential basics with clear examples you can run immediately.
Statements
A statement is a single instruction in JavaScript. Each statement usually performs one action.
Multiple statements can appear one after another.
Semicolons
Statements typically end with a semicolon (;). While JavaScript can often insert them automatically (ASI), it's best practice to include them for clarity and to avoid errors.
Case Sensitivity
JavaScript is case-sensitive: uppercase and lowercase letters are treated as different characters.
Comments
Comments are notes in the code that are ignored during execution. They help explain what the code does.
Single-line comments start with //
Multi-line comments use /* */
Code Execution Order
JavaScript executes code from top to bottom, line by line.
Quick Quiz
Hemos revisado y comprobado los materiales, pero aún pueden existir errores. El contenido se ofrece únicamente con fines educativos, así que úsalo bajo tu propia responsabilidad y verifica con otras fuentes si es necesario.
✨ Pregunta a Lara — tu compañera de estudio con IA
Desbloquea soporte de aprendizaje personalizado. Lara puede explicar lecciones, resumir temas y responder tus preguntas — disponible desde el plan Go y superiores.
Lara te ayuda a aprender más rápido — exclusivo para los miembros ReadyTools Go, Plus y Max.

