Shop detail

Javascript Basics 2023

50 

Description

JavaScript

JavaScript was initially created to “make web pages alive”.

The programs in this language are called scripts. They can be written right in a web page’s HTML and run automatically as the page loads.

Scripts are provided and executed as plain text. They don’t need special preparation or compilation to run.

In this aspect, JavaScript is very different from another language called Java.

Why is it called JavaScript?

When JavaScript was created, it initially had another name: “LiveScript”. But Java was very popular at that time, so it was decided that positioning a new language as a “younger brother” of Java would help.

But as it evolved, JavaScript became a fully independent language with its own specification called ECMAScript, and now it has no relation to Java at all.

Today, JavaScript can execute not only in the browser, but also on the server, or actually on any device that has a special program called the JavaScript engine.

The browser has an embedded engine sometimes called a “JavaScript virtual machine”.

Different engines have different “codenames”. For example:

  • V8 – in Chrome, Opera and Edge.
  • SpiderMonkey – in Firefox.
  • …There are other codenames like “Chakra” for IE, “JavaScriptCore”, “Nitro” and “SquirrelFish” for Safari, etc.

The terms above are good to remember because they are used in developer articles on the internet. We’ll use them too. For instance, if “a feature X is supported by V8”, then it probably works in Chrome, Opera and Edge.

How do engines work?

Engines are complicated. But the basics are easy.

  1. The engine (embedded if it’s a browser) reads (“parses”) the script.
  2. Then it converts (“compiles”) the script to the machine language.
  3. And then the machine code runs, pretty fast.

The engine applies optimizations at each step of the process. It even watches the compiled script as it runs, analyzes the data that flows through it, and further optimizes the machine code based on that knowledge.

What can in-browser JavaScript do?

Modern JavaScript is a “safe” programming language. It does not provide low-level access to memory or CPU, because it was initially created for browsers which do not require it.

JavaScript’s capabilities greatly depend on the environment it’s running in. For instance, Node.js supports functions that allow JavaScript to read/write arbitrary files, perform network requests, etc.

In-browser JavaScript can do everything related to webpage manipulation, interaction with the user, and the webserver.

For instance, in-browser JavaScript is able to:

  • Add new HTML to the page, change the existing content, modify styles.
  • React to user actions, run on mouse clicks, pointer movements, key presses.
  • Send requests over the network to remote servers, download and upload files (so-called AJAX and COMET technologies).
  • Get and set cookies, ask questions to the visitor, show messages.
  • Remember the data on the client-side (“local storage”).

What CAN JavaScript do?

JavaScript’s abilities in the browser are limited for the sake of a user’s safety. The aim is to prevent an evil webpage from accessing private information or harming the user’s data.

Examples of such restrictions include:

  • JavaScript on a webpage may not read/write arbitrary files on the hard disk, copy them or execute programs. It has no direct access to OS functions.Modern browsers allow it to work with files, but the access is limited and only provided if the user does certain actions, like “dropping” a file into a browser window or selecting it via an <input> tag.There are ways to interact with camera/microphone and other devices, but they require a user’s explicit permission. So a JavaScript-enabled page may not sneakily enable a web-camera, observe the surroundings and send the information to the NSA.
  • Different tabs/windows generally do not know about each other. Sometimes they do, for example when one window uses JavaScript to open the other one. But even in this case, JavaScript from one page may not access the other if they come from different sites (from a different domain, protocol or port).This is called the “Same Origin Policy”. To work around that, both pages must agree for data exchange and contain a special JavaScript code that handles it. We’ll cover that in the tutorial.This limitation is, again, for the user’s safety. A page from http://anysite.com which a user has opened must not be able to access another browser tab with the URL http://gmail.com and steal information from there.
  • JavaScript can easily communicate over the net to the server where the current page came from. But its ability to receive data from other sites/domains is crippled. Though possible, it requires explicit agreement (expressed in HTTP headers) from the remote side. Once again, that’s a safety limitation.

Such limits do not exist if JavaScript is used outside of the browser, for example on a server. Modern browsers also allow plugin/extensions which may ask for extended permissions.

What makes JavaScript unique?

There are at least three great things about JavaScript:

  • Full integration with HTML/CSS.
  • Simple things are done simply.
  • Supported by all major browsers and enabled by default.

JavaScript is the only browser technology that combines these three things.

That’s what makes JavaScript unique. That’s why it’s the most widespread tool for creating browser interfaces.

That said, JavaScript also allows to create servers, mobile applications, etc.

There are more. Of course, even if we use one of transpiled languages, we should also know JavaScript to really understand what we’re doing.

About the course

JavaScript is one of the most popular programming languages in the world, powering many of the interactive features you see on websites and web applications. Whether you’re a complete beginner or an experienced developer looking to brush up on your skills, the “JavaScript Basics” course on Udemy is the perfect place to start.

This fast-paced, concise course will take you from zero to hero in just 86 minutes, covering all the essential concepts you need to know to start writing JavaScript code. You’ll learn about data types, variables, functions, control flow, and more, as you build your own programs from scratch.

One of the unique features of this course is its focus on real-world examples and practical applications. You’ll work on hands-on exercises that simulate real-world scenarios, such as building a simple calculator or a dynamic web page. This approach not only makes the learning experience more engaging, but also ensures that you develop the skills you need to start building your own projects.

The course is designed to be accessible to everyone, regardless of their prior programming experience. The instructor, a seasoned developer with years of experience in JavaScript, takes a step-by-step approach that makes it easy to follow along, even if you’ve never written a line of code before. The lessons are presented in a clear, concise manner, with plenty of examples and visual aids to reinforce the concepts.

In addition to the video lessons, the course also includes a variety of supplemental resources to help you reinforce your learning. You’ll have access to quizzes and exercises that test your understanding of the material, as well as downloadable code examples that you can use as reference material as you work on your own projects.

At the end of the course, you’ll have a solid foundation in JavaScript programming, and the skills and confidence to start building your own web applications. Whether you’re interested in pursuing a career as a web developer or simply want to learn a valuable new skill, the “JavaScript Basics in 86 Minutes” course on Udemy is the perfect place to start. With its engaging, practical approach and expert instruction, this course is a must-have for anyone looking to master the fundamentals of JavaScript.

 

Course for you, if:

  • You want to become a web developer
  • Your are a developer who need to strengthen their understanding of JavaScript

Skills you will gain:

  • Understand how to configure Visual studio code for javascript
  • Learn shortcuts tips and tricks to use visual studio code editor efficiently
  • Understanding what is JavaScript & Why to use JavaScript
  • Understand how JavaScript works and it’s fundamental concepts from scratch
  • Learn new quick tips for coding faster in visual studio code