Some JavaScript Interesting Job Interview Topics For Beginners

Some important topics

1. Truthy and Falsy Value:

Truthy value means the truth value of a variable ,if the variable declares a false value then the value as a string type .this will be also true value because the value which is wrap with a double quotation is also a true value ,then if the value is wrap with a 0 , wrap with a empty string is also a truth value

Example: let name=’false’;

if(name){

console.log(“condition is true”);

}

else{

console.log(“condition is false”);

Output: “condition is true”

And the Falsy value is the false value of a variable ,such undefined ,null,NaN etc. are the falsy value of a declared variable

Example: let name=’null’;

if(name){

console.log(“condition is true”);

}

else{

console.log(“condition is false”);

Output : “Condition is false”

2 . Null And Undefined :

Null means the value is none .just like nothing is in the variable list …and the other hand undefined means the value that is not defined as well ….

const premik = {name:”smart dude”, phone:458421};

console.log(premik.gf);

output: undefined

here we cant access the gf property of premik ,because the gf property of the premik is not defined here ..

so it is undefined. .but we can also access name and the phone property as well

3. Double Equal (==) And Triple Equal (===)

This is the interesting topic of JavaScript ,the double equal is used in when two of them item are same quality in javascript

const first = 0;
const second = false;
if(first == second){
console.log(“condition is true”);
}
else{
console.log(“condition is false”);
}

here the answer is “condition is true” because the 0 is like a false value in the javascript ,but ..but …if we take a triple equal to them this answer will be false

const first = 0;
const second = false;
if(first === second){
console.log(“condition is true”);
}
else{
console.log(“condition is false”);
}

Because 0 is a number and the false value is a Boolean value of a string .

4.Remove duplicate item from an array

To remove duplicate item first we have to declared a new array ..for where the result is published.. the running the array with a loop ..as usual rule of JavaScript

here is a one condition ,if the index number of the element is equal to -1 .then the number is push in the new array …because when any element cant found in a array its index is -1.

5. How can we reverse a string

Here we reverse a string ,

first of all we declared a normal string and then declared a empty string for the new reverse string then gone through a loop in this code …

The output is that ….

6.Differences between Bind, Call And Apply

Bind is usually used for bring method from another object and use it ..if there is necessary to use a method is used in a previous part ,we can use the same method by using the bind function in JavaScript

Call method is like using by calling the method in to the objects and passes the parameter by using comma

but not bring the previous method but use same method in to the previous

Apply method is just like call function ,but there passing the parameter is with an array

7. Global Variable and Global Scope

When we declared a variable outside of a function ,it called global variable ,and global variable creates global scope

We can access the variable in function or outside of a function , All scripts and functions on a web page can access it. The scope of a variable refers to where is a variable visible or accessible. Global variables can be in a couple places, depending on how they’re set up

8.New keyword in JavaScript

New Keyword is used in JavaScript for creating a new object from class or a constructor function .when some objects have same category variable then we create a object from class .before es6 the new keyword is used many times ….

With New keyword ,it constructs and returns an object (instance) of a constructor function

class Person {

constructor(firstName, lastName, salary) {

this.firstName = firstName;

this.lastName = lastName;

this.salary = salary;

}}

const heroPerson = new Person(‘Hero’, ‘Balam’, 20000);

console.log(heroPerson);

here after creating the new object from person class …so new keyword is much essential in JavaScript ..

9. Accessibility

Web accessibility means the website that can be used by everyone .the design and creation of a website will be accessible to all people.. There are some standards and guideline to follow the accessibility of a web application ,they are :

  • The Web Content Accessibility Guidelines provides guidelines for creating accessible web sites.
  • The Web Accessibility Initiative — Accessible Rich Internet Applications document contains techniques for building fully accessible JavaScript widgets.
  • Using the various HTML elements to reinforce the meaning of information in our websites will often give us accessibility for free.

10. JavaScript Array map() Method

This method is created for a new array with the results of calling a new function for every array element .it calls the provided provided function once for each item of an array ,but map method does not change the previous array .it creates a new array from another array.

here new array is the …array that find from the previous array named “no”

JavaScript Lover