Photo by Headway on Unsplash

Coding is a basic part of programming job interviews, Javascript interviews are no exception. Here I make a list of the 15 most common Javascript programs for Job Interviews, which is very useful to prepare before appearing on any Javascript interviews.

1. Fibonacci series

Write a Javascript program that will take input and print the Fibonacci series(1 1 2 3 5 8 13 … .) up to user input.


Photo by Shahadat Rahman on Unsplash

JSX is a Markup language that looks similar to HTML but actually is a syntax extension for JavaScript. It’s easier to write code instead of pure Javascript. It allows developers to use HTML syntax to compose JavaScript components. Since it is a javascript extension, so the browser will not understands it unless you use a JSX compiler such as Babel. JSX used in order to create React elements. It provides syntactic sugar for the React.createElement(component, props, …children) function.

JSX as variables

JSX elements can act as values for identifiers. …


  1. Variable Naming

Always try to declare a meaningful name and avoid extra words. Please make sure when other developers read your code, they can understand the naming purpose.


Strings are simply groups of characters, like ‘Hello’, ‘Good Morning!’. They are an important global object in JavaScript. They represent a sequence of characters. JavaScript has many powerful built-in functions that make working with strings easy for developers. Here I will explain some most important methods s of javascript strings.

  1. string.indexOf(substr, [start]) — returns the index position of character value passed with method. If not found, -1 is returned.

Photo by Emile Perron on Unsplash

Destructuring is a convenient way of extracting multiple values from data stored in objects and Arrays. ES6 introduced some significant improvements to the language, including the de-structuring of Objects and Arrays. Honestly speaking, these are my favorite edition in the JavaScript standard syntax.

Object destructuring

Object destructuring takes a similar tack as array destructuring. Suppose you have a student object with two properties: name and id. Previously in javascript, when you want to assign the variables to the properties of the student object, you need to make a variable from something that is inside of an object like this:


Photo by Christopher Gower on Unsplash

JavaScript arrays are wonderful and they provide a lot of built-in methods. Using these methods we can do some efficient things with the list of benefits, like looping, accessing each value and index in the array, and a lot of other useful stuff. Today we are going to discuss some most useful array methods every developer should know. Let's get started.

filter()

Javascript array.filter() method creates a new array with all elements that pass the test implemented by the callback function.

Suppose you have an array of student objects where each object contains three properties: id and name and GPA. To…


Photo by Clément H on Unsplash

Destructuring is a convenient way of extracting multiple values from data stored in objects and Arrays. ES6 introduced some significant improvements to the language, including the de-structuring of Objects and Arrays. Honestly speaking, these are my favorite edition in the JavaScript standard syntax.

Array destructuring

Let us take a look if we want to extract data from an array in es5.


In JavaScript, Hoisting is the default behavior where variables and function declarations are moved to the top of their scope before code execution.

No Matter where function and variable are declared, it moved up top on their own scope. Doing this, it allows us to call functions before even writing them in our code.


What is Scope?

Scope determines the accessibility of variables. Each function when invoked creates a new scope. In JavaScript there are two types of scopes:
1. Global Scope
2. Local Scope

Global scope: variables defined outside of a function or curly braces {} are in the global scope. Once you’ve declared a global variable, you can use that variable anywhere in your code.

Abdullah Imran

Web Developer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store