Skip to content

yagiz-aydin/JS-50

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 

Repository files navigation

JS-50 Awesome

Introduction

1. Polymorphism

Polymorphism is the presentation of one interface for multiple data types. It provides an ability to call the same method on different JavaScript objects. As JavaScript is not a type-safe language, we can pass any type of data members with the methods.

Example with code

2. Inheritance

With most of the gory details of OOJS now explained, this article shows how to create "child" object classes (constructors) that inherit features from their "parent" classes. In addition, we present some advice on when and where you might use OOJS, and look at how classes are dealt with in modern ECMAScript syntax.

Example with code

3. Encapsulation

Encapsulation is the packing of data and functions into one component (for example, a class) and then controlling access to that component to make a "blackbox" out of the object. Because of this, a user of that class only needs to know its interface (that is, the data and functions exposed outside the class), not the hidden implementation.

Example with code

4. Singleton

The Singleton Pattern limits the number of instances of a particular object to just one. This single instance is called the singleton. SOLID five design principles intended to make software designs more understandable, flexible, and maintainable. The principles are a subset of many principles promoted by Robert C. Martin.

Example with code

5. Interfaces

JavaScript uses what's called duck typing. If object has quack(), walk(), and fly() methods without requiring the implementation of some "Duckable" interface. The interface is exactly the set of functions that the code uses and the return values from those functions.

Example with code

6. Closures

A closure is the combination of a function bundled together (enclosed) with references to its surrounding state (the lexical environment). In other words, a closure gives you access to an outer function's scope from an inner function. In JavaScript, closures are created every time a function is created, at function creation time.

Example with code

7. Global Execution Context (GEC) & Callstack

Whenever the JavaScript engine receives a script file, it first creates a default Execution Context known as the Global Execution Context (GEC). The GEC is the base/default Execution Context where all JavaScript code that is not inside of a function gets executed.For every JavaScript file, there can only be one GEC.

Example with code

8. Hoisting

JavaScript Hoisting refers to the process whereby the interpreter appears to move the declaration of functions, variables or classes to the top of their scope, prior to execution of the code. Hoisting allows functions to be safely used in code before they are declared.

Example with code

9. DOM

The Document Object Model (DOM) is a programming interface for web documents. It represents the page so that programs can change the document structure, style, and content. The DOM represents the document as nodes and objects; that way, programming languages can interact with the page.

Example with code

10. Let Const & Var

In JavaScript, users can declare a variable using 3 keywords that are var, let, and const. In this article, we will see the differences between the var, let, and const keywords. We will discuss the scope and other required concepts about each keyword. var keyword in JavaScript: The var is the oldest keyword to declare a variable in JavaScript.

Example with code

11. Promise & Await

The await operator is used to wait for a Promise. It can only be used inside an async function within regular JavaScript code. Await expression causes async function execution to pause until a Promise is settled (that is, fulfilled or rejected), and to resume execution of the async function after fulfillment. When resumed, the value of the await expression is that of the fulfilled Promise.

Example with code

12. Garbage Collection

Garbage Collection is a form of automatic memory management. The garbage collector attempts to reclaim memory which was allocated by the program, but is no longer referenced—also called garbage. The majority of Memory Management issues occur at this phase. The most difficult aspect of this stage is determining when the allocated memory is no longer needed.

Example with code

13. Linked List

A Linked List is a linear data structure similar to an array. Unlike arrays, elements are not stored in a particular memory location or index. Rather each element is a separate object that contains a pointer or a link to the next object in that list as each element. (commonly called nodes) How to implement Linked List ?

Example with code

14. Callback

A callback, also known as a call-after function is a function passed into another function as an argument, which is then invoked inside the outer function to complete some kind of routine or action.

Example with code

15. Bind Call Apply Functions

The call() and apply() are very similar methods. They both execute the bound function on the object immediately. The bind() method does not execute the function right away. Instead, it creates and returns a bound function that can be executed later.

For more details

16. Implicit & Explicit Bindings

In the case of implicit binding, this binds to the object adjacent to the dot(.) operator while invoking the method. In the case of explicit binding, we can call a function with an object when the function is outside of the execution context of the object. Difference Implicit, model instances are directly injected into the route or controller actions whose time-hinted variable names match a route segment name. Whereas in Explicit Binding the router’s model method to specify the class for a given parameter.

For more details

17. Caching & Memoize

Functions are an integral part of programming. They help add modularity and reusability to our code. Memoization is an optimization technique used primarily to speed up computer programs by storing the results of expensive function calls and returning the cached result when the same inputs occur again

For more details

18. Event Loop

JavaScript has a runtime model based on an event loop, which is responsible for executing the code, collecting and processing events, and executing queued sub-tasks. Please follow the link can find additional informations about Heap, Queue and Stack

For more details

19. Infinite Currying

Infinite Currying is essentially a technique for partial evaluations. Depending on how the function is invoked, the effect changes. Basically meaning that the context it’s used in effects the result of it.

For more details

20. CORS

CORS stands for Cross-Origin Resource Sharing, also known a security mechanism built into (all) modern web-browsers. The spec defines a set of headers that allow the browser and server to communicate about which requests are (and are not) allowed. CORS continues the spirit of the open web by bringing API access to all.

For more details

21. ECMAScript

ECMAScript is a scripting language specification on which JavaScript is based. Ecma International is in charge of standardizing ECMAScript.

For more details

22. Array

The Array object, as with arrays in other programming languages, enables storing a collection of multiple items under a single variable name, and has members for performing common array operations. In JavaScript, arrays aren't primitives but are instead Array objects with the following core characteristics. Please, go details for array methods.

For more details

About

Let’s learn the fundamentals of Javascript.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published