DEV Community

Cover image for 52 Frontend Interview Questions - JavaScript

52 Frontend Interview Questions - JavaScript

Yan Levin on August 12, 2023

Introduction A large number of beginner and experienced developers have started to encounter and notice a problem with job searching. In...
Collapse
 
brvhprince profile image
Prince Takyi Akomea

This is very helpful and useful. In addition to that, this a likely question for mid and senior entry Jobs.

Whatโ€™s the difference between observables and promises?

Observables and Promises are both used for handling asynchronous operations in JavaScript. A key difference is that Observables can emit multiple values over time. They are suitable for handling streams of data, such as user interactions, events, or data from APIs that change over time. Promises on the other hand can only resolve once with a single value. They are suitable for handling single asynchronous operations that will either succeed or fail.

In summary, Promises are best suited for handling one-time asynchronous operations with a single result, while Observables are more powerful when dealing with ongoing streams of data, events, and complex data processing pipelines. The choice between them depends on the specific use case and the nature of the asynchronous operations you're dealing with.

If you're curious to explore further, I have written a complete article on that, you can check it out here Promises Vs Observables: Decoding JavaScript's Asynchronous Superheroes!

Collapse
 
fruntend profile image
fruntend

ะกongratulations ๐Ÿฅณ! Your article hit the top posts for the week - dev.to/fruntend/top-10-posts-for-f...
Keep it up ๐Ÿ‘

Collapse
 
robinamirbahar profile image
Robina

Amazing Job

Collapse
 
skamansam profile image
Samuel • Edited

You can create a deep copy with structuredClone(). This is probably the recommended way going forward. See developer.mozilla.org/en-US/docs/W...

Collapse
 
ianbonaparte profile image
Ian Bonaparte

Thank you for sharing this list. I have been getting to and bombing the tech portion of interviews lately...this will help me brush up on some of the basics.

Collapse
 
shagun profile image
Shagun Bidawatka

Very helpful! Thanks..

Collapse
 
rishamason profile image
Risha

Well done! Thank you. This is very helpful for everyone

Collapse
 
aigengrau profile image
Anis Ochilov

Very helpful, thank you

Collapse
 
rollercoaster_ride profile image
Rollercoaster Ride • Edited

The above questions are really important but in the technical round interview prep, you will consider the below article trust me you won't regret it.
I have covered: semantics, box model, event-loop, hoisting, and closure....25+
๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡
Frontend Interview Key Points

Collapse
 
saeedjlnsi profile image
saeed jalinoosi

Typo?: With Function Declaration, the function is created and assigned to a variable, just like any other value. Essentially, it doesn't matter how the function is defined, as it is a value stored in the variable "foo".

With function expression....

Collapse
 
moniv9 profile image
Info Comment hidden by post author - thread only accessible via permalink
Mohit Verma

You can also use this curated list of frontend questions for practise - mohit8.gumroad.com/l/ygass

Collapse
 
dzienisz profile image
Kamil Dzieniszewski

Answer to question 1 is not pressies. I should be that all data types are primitives except object.

developer.mozilla.org/en-US/docs/W...

Collapse
 
moniv9 profile image
Mohit Verma

Can also use PrepareFrontend for more frontend questions for interview preparation
preparefrontend.com

Collapse
 
johnthemilesi profile image
Joao Milesi

I'm new to javascript. Learned a lot with your post, thank you.

Collapse
 
bwin profile image
Benjamin Winkler

19) The proper name is conditional operator.
Ternary is the arity (unary, binary, ternary, n-ary), so it just describes the number of operands the operator takes.

Some comments have been hidden by the post's author - find out more