Home >Web Front-end >JS Tutorial >Javascript fundamentals - The beginning

Javascript fundamentals - The beginning

王林
王林Original
2024-07-25 16:14:03852browse

Javascript fundamentals - The beginning

Some new developers or even those experience, can face it issues or difficulties case don't have a solid knowledge of the fundamentals.

To solve this, in this series, i wanna recap the javascript fundamentals to keep it fresh and to help any dev that come here to remember any specific topic.

First of all, What we gonna talk about?

All javascript fundamentals, from scratch to hero!

The fundamentals

What is Javascript?

Javascript is a programming language rich and complex, it be able to apply in very scenarios and a wide applications range.

Here we can see some exclusive characteristics:

  • Is a interpreted and JIT compiled programming language;
  • Has dynamic types;
  • Based on Prototypes;
  • Create with First-class functions;
  • Has clousores;
  • Event loop and non-blocking I/O;
  • Error handling with try/catch;
  • Flexible objects and arrays;
  • Template strings;
  • Modularity and support for module imports;
  • Support to asyncronhuos programming;

And much more...

For our porpose, these characteristics that's enough. We gonna explore each one of those points, we going get a solid knowledge of them.

Intepreted and JIT compiled

Javascript was traditionallity an interpreted language, meaning code is executed line by line. Nowdays, with advanced Javascript engines most code is compiled on the fly using Just in Time techniques to improve performance.

Dynamic types

JavaScript is a dynamically typed language, allowing the same variable to store different types of data at different times. This offers flexibility, but can also lead to errors that are more difficult to track down.

Prototypes

Instead of using traditional classes found in languages like C++ or Java, JavaScript uses prototypes for inheritance. This allows inheritance of properties and methods from one object to another.

First-class functions

JavaScript treats functions as first-class objects, allowing them to be assigned to variables, passed as arguments to other functions, returned from functions, and have their own properties and methods.

Closure

JavaScript supports closures, a powerful feature that allows functions to remember and access variables in the scope where they were created, even after the outer scope has ended.

The above is the detailed content of Javascript fundamentals - The beginning. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn