Frontend Interview Questions

Frontend Interview Questions

1.) What do you understand by Version Control System?

A Version Control System (VCS) is a program that is used to record any changes to a file or set of data so that we can restore it to a previous version if needed. It ensures that everyone on the team is working on the most up-to-date file version.

2.) What is Coffee Script? Describe in brief.

CoffeeScript is a lightweight programming language that compiles into JavaScript. It is used to exhibit the good parts of JavaScript simply. It also enables developers to write JavaScript code better by providing constant syntax.

3.) What do you understand by a callback function?

A callback function is a function that is passed as an argument to another function and ensures that a function is not going to run before a task is completed. This function runs right after the task has been completed.

4.) What do you understand by clear?

A clear is used when we don’t need an element to wrap around another element, like float.

5.) What is the key difference between Class and Prototype-based inheritance?

The most important difference between class-based and prototype-based inheritance is that a class defines a type that can be instantiated at runtime. On the other hand, a prototype is itself an object instance. In JavaScript, the object system is prototype-based, not class-based. That’s why inheritance in JavaScript is different from other programming languages.

Objects are just a collection of name and value pairs in JavaScript. In JavaScript inheritance, there is only one construct, called object. Every object has private property linked to another object known as its prototype.

6.) What is the key difference between Null and Undefined in JavaScript?

Many people think that Null and Undefined are the same in JavaScript, but they have many differences. In the following table, we have included the key differences between them:

Null Undefined
A null is an object with no value. Undefined is a type.
Null is an intentional absence of the value. It is one of the primitive values of JavaScript. In Undefined, the value does not exist in the compiler. It is the global object.
typeof null; // “object” typeof undefined; // “undefined”
Null is equal to undefined but not identical.
null == undefined // true
null === undefined // false

7.) What is the difference between Visibility:Hidden;and Display:None;?

The Visibility:Hidden; and Display:None; both are used in front-end development when we don’t want to display things on the screen.

  • Visibility:Hidden; is used when you don’t want to show the things in output. It is not visible but contains its original space.
  • Display:None; is also used to hide the things on the screen, but it doesn’t take any space.

8.) What is the importance of HTML DOCTYPE?

In HTML, the DOCTYPE declaration points to a Document Type Definition (DTD). It is used to instruct the web browser about what version of the markup language the page is written. The DOCTYPE declaration is written as the first thing in the HTML document, before the <html> tag. It is a set of markup language rules that makes the browser easily and correctly interpret the content written within.

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *