What is JavaScript?

Programming with Mosh
23 Apr 201805:12

Summary

TLDRThis video provides an insightful introduction to JavaScript, answering key questions such as what JavaScript is, its uses, where it runs, and the difference between JavaScript and ECMAScript. The video highlights JavaScript's popularity, its applications in web and mobile development, and the role of Node.js in running JavaScript outside of browsers. Additionally, it explains ECMAScript's role in standardizing JavaScript features. The tutorial includes a practical demo of writing JavaScript code in the Chrome console, offering a hands-on learning experience for viewers.

Takeaways

  • 🌐 JavaScript is a highly popular programming language used globally and is experiencing rapid growth.
  • 📈 Major companies like Netflix, Walmart, and PayPal use JavaScript to build internal applications, offering significant job opportunities for developers.
  • 💰 JavaScript developers in the United States have an average salary of $102,000 per year, making it a lucrative career choice.
  • 🔄 JavaScript can be used for front-end, back-end, and full-stack development, offering versatility in web development roles.
  • 🚀 JavaScript was initially used for building interactive web pages but now supports building full web and mobile apps, real-time networking applications, command-line tools, and games.
  • 🖥️ JavaScript code runs in browsers using JavaScript engines like SpiderMonkey (Firefox) and V8 (Chrome), but it can also run outside browsers using Node.js.
  • 🔧 Node.js is a C++ program embedding the V8 JavaScript engine, allowing JavaScript to be used for server-side development.
  • 🌍 JavaScript can execute in two main environments: browsers and Node.js, both providing a runtime environment for the code.
  • 📜 ECMAScript is a specification that JavaScript adheres to. JavaScript is a language that conforms to ECMAScript standards.
  • 📅 ECMAScript 2015 (ES6) introduced many new features for JavaScript, with yearly updates following since 2015 by the standards body ECMA.
  • 🖱️ Developers can easily test JavaScript code in the browser's developer console by using commands like `console.log('Hello World')` and `alert('Yo')`.

Q & A

  • What is JavaScript?

    -JavaScript is one of the most popular and widely used programming languages in the world. It's growing faster than any other programming language and is used by big companies like Netflix, Walmart, and PayPal for building internal applications.

  • What can you do with JavaScript?

    -JavaScript can be used to build interactive web pages, full-blown web or mobile apps, real-time networking applications like chats and video streaming services, command-line tools, and even games.

  • Where does JavaScript code run?

    -JavaScript code can run inside browsers or in Node.js. Browsers have JavaScript engines that execute the code, such as SpiderMonkey in Firefox and V8 in Chrome. Node.js, a C++ program that includes Google's V8 JavaScript engine, allows JavaScript code to run outside of browsers.

  • What is the difference between JavaScript and ECMAScript?

    -ECMAScript is a specification, while JavaScript is a programming language that conforms to this specification. ECMAScript is defined by an organization called ECMA, which releases annual updates to the specification, such as ECMAScript 2015 (ES6).

  • Why is JavaScript referred to as a toy language by some developers?

    -JavaScript was initially used only in browsers to build interactive web pages, leading some developers to consider it a toy language. However, due to community support and investments by companies like Facebook and Google, JavaScript's capabilities have expanded significantly.

  • How did Node.js change the use of JavaScript?

    -Node.js, created by Ryan Dahl in 2009, embedded Chrome's V8 JavaScript engine inside a C++ program. This allowed JavaScript to run outside of browsers, enabling the development of backend applications for web and mobile apps using JavaScript.

  • What tools do you need to write JavaScript code?

    -For a quick demo, you can use the JavaScript console in a browser's developer tools. For real-world applications, you would set up a development environment with tools like Node.js, a code editor, and possibly other frameworks and libraries depending on the project.

  • What are some examples of JavaScript engines in browsers?

    -Examples of JavaScript engines in browsers include SpiderMonkey in Firefox and V8 in Chrome. These engines execute JavaScript code within the browser.

  • What does the 'console.log' function do in JavaScript?

    -The 'console.log' function in JavaScript is used to print messages to the JavaScript console. It's commonly used for debugging purposes to check values and outputs of expressions.

  • What is the significance of ECMAScript 2015 (ES6)?

    -ECMAScript 2015 (ES6) introduced many new features and improvements to JavaScript, such as arrow functions, classes, template literals, and more. It marked a significant update to the language and set the standard for future developments.

Outlines

00:00

🔍 Introduction to JavaScript

The speaker introduces the video as a 3-minute session addressing four common questions about JavaScript: What is JavaScript, what can you do with it, where does JavaScript code run, and what is the difference between JavaScript and ECMAScript. JavaScript is highlighted as a highly popular and rapidly growing programming language, used by major companies like Netflix, Walmart, and PayPal for internal applications. The potential for high salaries and diverse job roles (front-end, back-end, or full-stack developer) is also mentioned.

05:02

🛠️ Uses of JavaScript

JavaScript was historically used only in browsers to create interactive web pages, often dismissed as a 'toy language.' However, its capabilities have expanded significantly due to community support and investments from large companies like Facebook and Google. Nowadays, JavaScript can be used to build web and mobile apps, real-time networking applications like chats and video streaming services, command-line tools, and even games.

🌐 Where JavaScript Runs

JavaScript was initially designed to run exclusively in browsers, with each browser having its own JavaScript engine (e.g., SpiderMonkey in Firefox and V8 in Chrome). In 2009, Ryan Dahl created Node.js by embedding Chrome's V8 engine into a C++ program, allowing JavaScript to run outside of browsers. This means JavaScript can now be used for backend development as well. JavaScript code can run inside browsers or Node.js, both providing runtime environments for it.

📝 JavaScript vs. ECMAScript

ECMAScript is a specification, while JavaScript is a programming language that conforms to this specification. The organization responsible for ECMAScript, Ecma International, defines standards for the language. ECMAScript's first version was released in 1997, and since 2015, new versions have been released annually. ECMAScript 2015 (also known as ES6) introduced many new features to JavaScript.

🚀 JavaScript in Action

The speaker demonstrates how to write and execute basic JavaScript code in a browser. By opening Chrome, inspecting the page, and using the console tab, users can run JavaScript commands directly. Examples include logging 'Hello World' to the console, performing basic arithmetic, and displaying alerts. This segment serves as a quick demo, with a promise of more detailed instruction in subsequent lectures on setting up a development environment for JavaScript.

📚 Further Learning

The speaker, Mashar, briefly mentions that this tutorial is part of a comprehensive JavaScript course covering essential concepts and featuring numerous exercises and solutions. The course offers a certificate of completion, and interested viewers can find more information in the video description. The next section of the tutorial will continue to provide valuable content on JavaScript.

Mindmap

Keywords

💡JavaScript

JavaScript is a popular and widely used programming language. It is essential for creating interactive web pages and applications. In the video, JavaScript is described as being utilized by major companies like Netflix, Walmart, and PayPal for internal applications.

💡Front-end developer

A front-end developer is responsible for creating the visual and interactive aspects of a website that users engage with directly. The video mentions that learning JavaScript can lead to a job as a front-end developer, emphasizing the language's importance in web development.

💡Back-end developer

A back-end developer works on the server-side of web applications, handling databases, server logic, and application integration. JavaScript, through environments like Node.js, allows developers to build the back-end of web and mobile applications.

💡Full stack developer

A full stack developer is skilled in both front-end and back-end development, capable of creating a complete web application. The video highlights that mastering JavaScript can enable one to become a full stack developer, handling all aspects of an application's development.

💡JavaScript engine

A JavaScript engine is a program that executes JavaScript code. Examples include SpiderMonkey in Firefox and V8 in Chrome. The video explains that these engines allow JavaScript to run in browsers, and with Node.js, JavaScript can also run outside of browsers.

💡Node.js

Node.js is a runtime environment that allows JavaScript to be executed on the server-side. It was created by embedding the V8 JavaScript engine in a C++ program. The video mentions that Node.js enables JavaScript to build back-end services and run outside the browser.

💡ECMAScript

ECMAScript is a specification for scripting languages, with JavaScript being one of the most well-known implementations. The video discusses how ECMAScript defines the standards that JavaScript follows, with updates and new features being released periodically.

💡ES6

ES6, or ECMAScript 2015, is a version of the ECMAScript standard that introduced many new features to JavaScript. The video notes that ES6 brought significant improvements to the language and is a key point in JavaScript's development history.

💡Console

The console is a developer tool available in web browsers that allows developers to write and test JavaScript code directly in the browser. The video demonstrates using the console to execute basic JavaScript commands like 'console.log' and 'alert'.

💡Alert

The 'alert' function in JavaScript creates a pop-up message in the browser. The video uses 'alert' as an example to show how JavaScript can produce immediate, visible effects in a web page by displaying a message to the user.

Highlights

JavaScript is one of the most popular and widely used programming languages in the world right now.

Big companies like Netflix, Walmart, and PayPal build internal applications around JavaScript.

The average salary of a JavaScript developer in the United States is about $120,000 a year.

You can work as a front-end developer, back-end developer, or a full-stack developer with JavaScript knowledge.

JavaScript was initially used only in browsers to build interactive web pages.

JavaScript can now be used to build full-blown web or mobile apps, real-time networking applications, command-line tools, and even games.

JavaScript was originally designed to run only in browsers with engines like SpiderMonkey (Firefox) and V8 (Chrome).

Node.js, created by Ryan Dahl, allows JavaScript to run outside of browsers by embedding the V8 engine in a C++ program.

With Node.js, JavaScript can be used to build the backend for web and mobile applications.

JavaScript code can run inside a browser or in Node.js, which provide runtime environments for JavaScript code.

ECMAScript is a specification, while JavaScript is a programming language that conforms to this specification.

ECMAScript is managed by an organization called ECMA, which defines the standards for JavaScript.

The first version of ECMAScript was released in 1997, with annual releases starting from 2015.

ECMAScript 2015 (ES6) introduced many new features for JavaScript.

Using Chrome's developer tools, you can write and execute JavaScript code directly in the console.

This tutorial is part of a complete JavaScript course that includes exercises, solutions, and a certificate of completion.

Transcripts

play00:00

[Music]

play00:01

in the 3-minute introduction I'm going

play00:04

to answer for frequently asked questions

play00:06

about JavaScript

play00:08

what is JavaScript what can you do with

play00:10

it where does JavaScript code run and

play00:13

what is the difference between

play00:14

JavaScript and echo script so let's

play00:17

start with the first question what is

play00:19

JavaScript JavaScript is one of the most

play00:22

popular and widely used programming

play00:24

languages in the world right now it's

play00:27

growing faster than any other

play00:28

programming languages and big companies

play00:30

like Netflix Walmart and PayPal build

play00:34

internal applications around javascript

play00:36

and here's the average salary of a

play00:38

JavaScript developer in the United

play00:40

States and it's only $2,000 a year so

play00:44

it's a great opportunity to get a good

play00:46

job out of learning JavaScript you can

play00:48

work as a front-end developer or a

play00:51

back-end developer for a full stack

play00:53

developer who knows both the front end

play00:55

and the back end now the second question

play00:57

what can you do with JavaScript for a

play01:00

long time

play01:01

javascript was only used in browsers to

play01:03

build interactive web pages some

play01:06

developers refer to javascript as a toy

play01:08

language but those days are gone because

play01:11

of huge community support and

play01:13

investments by large companies like

play01:15

Facebook and Google these days you can

play01:17

build full-blown web or mobile apps as

play01:20

well as real time networking

play01:22

applications like chats and video

play01:24

streaming services command-line tools or

play01:27

even games here's an example a third

play01:31

question where does JavaScript code run

play01:34

javascript was originally designed to

play01:36

run only in browsers so every browser

play01:39

has what we call a JavaScript engine

play01:41

that can execute JavaScript code for

play01:44

example the JavaScript engines in

play01:46

firefox and chrome are SpiderMonkey and

play01:49

v8 in 2009 a very clever engineer called

play01:53

Ryan Dahl took the open-source

play01:56

JavaScript engine in chrome and embedded

play01:59

it inside a C++ program he called that

play02:02

program node the node is a C++ program

play02:05

that includes Google's v8 JavaScript

play02:09

engine now with this we can run

play02:12

JavaScript code out

play02:13

of a browser so we can pass our

play02:15

JavaScript code to node for execution

play02:18

and this means with JavaScript we can

play02:20

build the backend for our web and mobile

play02:23

applications so in a nutshell JavaScript

play02:26

code can be run inside of a browser or

play02:28

in node browsers and node provide a

play02:31

runtime environment for our JavaScript

play02:34

code and finally the last question what

play02:37

is the difference between JavaScript and

play02:39

Eggman script well ECMO script is just a

play02:42

specification javascript is a

play02:44

programming language that confirms to

play02:46

this specification so we have this

play02:49

organization called a comma which is

play02:51

responsible for defining standards they

play02:54

take care of this Eggman script

play02:55

specification the first version of

play02:58

Eggman script was released in 1997 then

play03:01

starting from 2015

play03:03

ACMA has been working on annual releases

play03:06

of a newest specification so in 2015

play03:09

they released a kimono script 2015 which

play03:12

is also called ECMO script version 6 or

play03:15

es6 for short this specification defined

play03:18

many new features for JavaScript alright

play03:21

enough theory

play03:22

let's see javascript in action so every

play03:25

browser has a JavaScript engine and we

play03:27

can easily write JavaScript code here

play03:29

without any additional tools of course

play03:31

this is not how we build real-world

play03:33

applications but this is just for a

play03:35

quick demo so open up Chrome right click

play03:38

on an empty area and go to inspect now

play03:42

this opens up chrome developer tools

play03:44

here select the console tab this is our

play03:47

JavaScript console and we can write any

play03:49

valid JavaScript code here so type this

play03:52

console dot log put a single code here

play03:58

and then hello world another single code

play04:01

to terminate close the parentheses and

play04:05

add a semicolon at the end now as you go

play04:08

through the course you're going to

play04:09

understand exactly what all this means

play04:11

for now don't worry about it so now I'll

play04:13

press ENTER and you can see the hello

play04:15

world message on the console we can also

play04:18

write mathematical expressions here for

play04:20

example two plus two we get four or we

play04:24

can do something like this alert

play04:26

practices single coat yo enter and

play04:30

here's an alert in the next lecture I'm

play04:33

going to talk about setting up your

play04:35

development environment for writing

play04:37

JavaScript code

play04:40

well hello it's mahshar thank you for

play04:43

watching my javascript tutorial I just

play04:45

wanted to quickly let you know that this

play04:47

tutorial is part of my complete

play04:49

JavaScript course where you can learn

play04:51

about all the essential concepts in

play04:53

JavaScript the course is packed with

play04:55

lots of exercises and solutions and by

play04:57

the end of watching the course you will

play04:59

also receive a certificate of completion

play05:01

in case you're interested you can find a

play05:03

link in the video description and if not

play05:05

that's perfectly fine continue watching

play05:07

as the next section is coming up

Rate This

5.0 / 5 (0 votes)

Etiquetas Relacionadas
JavaScriptProgrammingWeb DevelopmentBeginner GuideCoding TutorialECMAScriptFront-EndBack-EndWeb AppsNode.js
¿Necesitas un resumen en inglés?