Aprende JAVASCRIPT en 10 minutos 🟡

Aprende JAVASCRIPT en 10 minutos 🟡

Introduction to JavaScript Programming

Overview of JavaScript

  • JavaScript is a multi-paradigm programming language that supports event-driven, functional, imperative, procedural, and object-oriented programming.
  • Created in 1995 by Brendan Eich at Netscape, it is primarily used for client-side interactivity in web pages and applications but also runs on the server side with Node.js.

Learning Curve

  • While learning a programming language can be easy, achieving professional-level skills requires months to years of practice to tackle complex industry problems.

Setting Up the Development Environment

Installation Steps

  • Before coding, set up your environment by downloading a text editor; Visual Studio Code (VSCode) is recommended.
  • Install Node.js to run JavaScript on your computer. Verify installation by typing node -v in the terminal.

Writing Your First JavaScript Code

Creating and Running Your First Script

  • Create a new file named index.js, write console.log('Hello World');, save it, and run it using node index.js in the terminal to print "Hello World".

Understanding Comments and Variables

Documentation and Data Storage

  • Use comments (// This is a comment) for documentation within code.
  • Variables are essential for storing data; common types include strings (text), numbers (integers and decimals), booleans (true/false), arrays (lists), and objects (dictionaries).

Data Types in JavaScript

Variable Declaration Examples

  • Declare variables using let. For example:
  • let book = 'The Pragmatic Programmer';
  • You can also store phone numbers or colors as strings.

Complex Data Structures

  • Arrays allow ordered storage of multiple data types. Example: [1, 2, 3].
  • Objects enable quick access to properties via keys. Example:

let players =

'10': 'Messi',

'7': 'Cristiano Ronaldo'

;

Constants and Operators

Defining Constants

  • Use const for constants whose values cannot change. Example:

const PI = 3.14;

Operator Types

  • Arithmetic operators perform basic math operations like addition (+), subtraction (-), multiplication (*), division (/).

Comparison Operators

Value Comparison Techniques

  • Comparison operators check equality or inequality between values:
  • Use == for value comparison.
  • Use === for strict type comparison.
  • Other comparisons include <, >, etc., yielding boolean results.

Logical Operators & Conditionals

Logical Operations Explained

  • Logical operators evaluate conditions:
  • AND (&&) returns true if both operands are true.
  • OR (||) returns true if at least one operand is true.

Conditional Statements Usage

  • Conditional statements control code flow based on conditions. For instance:

if (authorized === true)

// Execute code block if authorized is true.

Understanding Conditional Statements and Functions in Programming

Conditional Statements

  • The speaker explains how to use conditional statements, starting with an example of checking if a variable is true or false. If true, it prints "puedo ingresar"; otherwise, it prints "no puedo ingresar."
  • Introduces comparative operators by comparing an integer variable's value (100) against another value (99). Discusses the use of else if for multiple conditions and concludes with printing the result when the condition is met.
  • Describes the switch statement as a way to compare a given argument against multiple cases (e.g., colors like green and yellow), demonstrating its functionality through an example that results in a warning message.

Functions

  • Defines functions as reusable blocks of code. The speaker illustrates this by creating a function named sumar, which takes two arguments and returns their sum.
  • Shows how to call the function with specific values (3 and 4), storing the returned result in a variable before printing it to the console, resulting in an output of 7.
  • Mentions that functions can be complex; for instance, using a sorting function (quicksorted) on an unordered list yields an ordered list.

Loops: Iterating Through Data

Using Loops

  • Explains loops as tools for repeating code sections multiple times. They are particularly useful for iterating over elements in lists.
  • Demonstrates a for loop that iterates through each element in a list called animales, printing each animal's name during each iteration.
  • Introduces the while loop, which is used here to print numbers from 100 up to 911 by incrementing a variable during each iteration.

Object-Oriented Programming Concepts

Introduction to Objects

  • Discusses object-oriented programming (OOP), emphasizing its importance for larger projects. It involves transforming real-world concepts into code where everything becomes an object.
  • Illustrates creating objects with properties and methods using JavaScript. An example includes defining an object named javascript with a method that logs its creation year.

Classes and Constructors

  • Introduces classes as blueprints for creating objects. A class named lenguaje is defined, including properties such as name and year within its constructor method.
  • Details how properties are assigned values passed during object creation using the constructor method while also defining additional methods like descripcion.

Creating Instances

  • Shows how to create instances of classes using the keyword new. An instance of class lenguaje is created representing JavaScript, followed by calling its description method to display information about it.

Modular Code Structure

Importance of Modules

How to Create and Use JavaScript Modules

Creating a New Module

  • The speaker discusses organizing code by creating a new file named módulo.js, where they define a function called restar. They emphasize the importance of using the export keyword to make this function available for use in other files.
  • In the index.js file, the speaker demonstrates how to import the restar function using the import statement. They specify the path to their module file with single quotes, ensuring proper syntax for importing functions.

Setting Up Project Configuration

  • The speaker mentions creating a configuration file named package.json, where they set the project type as "module". This step is crucial for enabling ES6 module syntax in Node.js environments.

Running and Testing Code

  • After setting up, they run their code again, illustrating how libraries or modules are created in JavaScript. The speaker reassures viewers that these steps are foundational for starting programming projects effectively.

Learning Opportunities

  • The speaker invites viewers to join "Academia X" for professional-level programming education. They highlight that participants will create their first website and portfolio while preparing for job interviews with essential skills like data structures and algorithms.
Video description

Aprende a programar con JavaScript en 15 minutos desde cero! 🟡 📕 ¡Guía de JavaScript Gratis! 👉 https://academia-x.com/aprende-javascript-guia-completa-gratis 🚀 Conviértete en Programador Profesional 👉 https://www.academia-x.com 🖥 Equipos recomendados 👉 https://www.amazon.com/shop/programadorx (enlace afiliado) ---------------------------------------- Sígueme en mis redes 📰 https://www.linkedin.com/in/xavier-reyes-ochoa https://www.instagram.com/programador.x https://www.tiktok.com/@programador.x https://www.facebook.com/programadorxyz https://www.youtube.com/@ProgramadorX ---------------------------------------- Cursos gratuitos 🎁 📘 Edita código con VSCode 👉 https://bit.ly/3UEMoNq 📕 Usa inteligencia artificial con ChatGPT 👉 https://bit.ly/4beDOtQ 📙 Publica páginas web 👉 https://bit.ly/3w35QtI 📗 Aprende a programar con Python 👉 https://bit.ly/3UmdCXw Cursos premium 🚀 📚 Bootcamp de HTML, CSS, JavaScript, Hosting, React, Angular, SQL, Node.js, Python, Algoritmos, Diseño de Sistemas, Preparación para Entrevistas y AWS 👉 https://bit.ly/4aSXJPw ╔═╦═╦═╦══╦═╦══╦═╦═╦══╦══╦═╦═╗ ╔╗╔╗ ║╬║╬║║║╔═╣╬║╔╗║║║║║╔╗║╗╗║║║╬║ ╚╗╔╝ ║╔║╗╣║║╚╗║╗╣╠╣║║║║║╠╣║╩╝║║║╗╣ ╔╝╚╗ ╚╝╚╩╩═╩══╩╩╩╝╚╩╩═╩╩╝╚╩══╩═╩╩╝ ╚╝╚╝ Este tutorial para principiantes es un excelente lugar para empezar si quieres ser programador/a y deseas obtener los conocimientos básicos sobre la lógica de programación en este lenguaje. Este no es un curso completo de JavaScript, sin embargo, te ayudará a tener una mejor noción de este lenguaje en tiempo record como aspirante a Ingeniero/a de software Junior. 📚 Contenido 0:00 - Lógica de Programación 👩‍💻 Aprende a programar en JavaScript 0:49 - Configuración 1:18 - Hola Mundo 1:52 - Comentarios 2:10 - Variables 3:50 - Contantes 4:09 - Operadores 5:42 - Condicionales 6:51 - Funciones 8:08 - Ciclos, Bucles, o Loops 9:26 - Programación Orientada a Objetos 10:29 - Clases 11:54 - Módulos 13:03 - Academia X #javascript #programacionweb #programadorX #html #css #javascript #react #programador #programacion #ingeniero #ingenieria #desarrolloweb #frontend #backend #software 🎁👇 ------------------------------------------------------------------------------------------------ 🥚 10% OFF | ACADEMIA-X.COM | código: PROGRAMADORX ------------------------------------------------------------------------------------------------