Javascript core concepts that we need to know…

How works Primitives Values?

Primitive Values include, among other things, numbers and strings. Using console.log(), open your browser’s console and print the following primitive values:

console.log(Hi);

There is one thing that all primitive values have in common. Nothing I can do in my code would have any effect on them.

What are Objects and Functions?

Objects: Almost all of the things are objects. Boolean, Numbers, Strings, Dates, Dates, Maths, Regular expressions, Arrays, Functions. All JavaScript values, except primitives, are objects.

Function: Basically, a function is a “subprogram” that can be called by code that is external to the function. A function like a program is made up of a series of statements called the function body. A function may be given values and the function will return a value.

object and function

Try and Catch how it will work?

JavaScript attempts to catch The try statement lets you define a section of code that will be checked for errors as it runs. If an error occurs in the try block, you can use the catch statement to define a block of code that will be executed.

try and catch

JavaScript Comments?

Comments basically help to code and remind us what we will do in the previous code. In javascript, we can see the comments which help to find explanations inside the code. we should follow the short comments which help to easily understand.

Example:

Eventloop in Javascript?

We know that JavaScript operates as a single thread, but there are times when we get the impression that it operates as a multi-threaded process. This diagram shows that an event loop has four components: a call stack, a web API, an event queue, and an event loop. The call stack in JavaScript is responsible for keeping track of all the operations in a line that needs to be executed. The call stack in JavaScript is responsible for keeping track of all the operations in a line that needs to be executed. When a function is completed, it rises to the top of the stack. After all, the function called it sent a request to the web API. The API begins its single-threaded operation based on the command received from the call stack.
The event queue’s function is to send new functions to the track for processing. It always keeps the queue data structure to keep the correct sequence for all current operations. After completing one execution, the event loop continuously checks to see if the stack is empty. If it is empty, new functions from the event queue are added.

javascript

What about Caching ?

Caching is the process of storing data in a common storage location for a set period so that it can be called and collected quickly when needed. This caching method also reduces the cost of data retrieval from the database, making the application run faster. We now have client and server sites in a web application. Both use different kinds of caching systems. That has client caching and server caching.

What are Cross browsing testing and its purpose?

Cross browsing testing is testing that provides the capability of multiple browsers to access any kind of in one application. cross browsing testing follows some steps:

i. Initial planning: First and foremost, you must plan how your website will function, how it will look, who will be your audience, and what browser will be the most commonly used for the website.

ii. Development: Based on your plan, you can now create a separate part of your overall work and design how the work can be done with small, simple modules, and then develop the modules.

iii. Testing: After developing the system, you must now test it. You must test whether or not all of the functionality is operating smoothly, and whether or not the browser required to browse your site is operational. During this phase, you must identify any bugs in your system.

iv. Fixes: After locating the bugs, you must resolve the issue for your system to function properly. You must figure out where and why the bugs are appearing and then find a solution for them.

Default Parameter Values with functions?

we can see a parameterized function, but the parameter can have a default value or can be undefined.

As we can see, the default value of y is set to 3, so if you do not provide a value for y, it will work with its default value and return the result.

What is Block Binding?

In Block binding, Variables are created at the point where the declaration occurs in most c-based languages. However, this is not the case in JavaScript. The location of your variables is determined by how you declare them, and E6 provides options to make controlling extension easier.

Data Cost?

The cost of data is the cost incurred for each operation or function. It can originate from any system factor. As a result, it is critical to determine who will bear the cost. In general, the user should bear the cost, but this may not always be possible because the cost can be very high. As a result, the cache is used to reduce the time required for data access and, as a result, the cost of data.