Sign in
Log inSign up

Today's javascript interview questions

Divyesh Parmar's photo
Divyesh Parmar
·Jan 29, 2022·

2 min read

let a = [1, 2, 3, 4, 5];
a = a.map(item => item<3);
let a = [1, 2, 3, 4, 5];
a = a.map(item => item<3);
let a = [1, 2, 3, 4, 5];
a = a.some(item => item< 3);

which he told will return the mixture of .map() and .filter() 's result :D

  • then question on writing a reducer function to return the sum of an array which I thnk I have wrote wrong
const sum = arr.reduce((total, value) => total + value, 0);

Redux

  • are Providers a Higher Order Components? there was no mention of Consumer and he took the mention of consumer with regards to how react-redux connect function works instead of how it works in Context API
  • what is actions in Redux
  • why is Reducer needed when we can directly mutate the state?

React

  • How much do you rate yourself in React :D :D :D :D
  • What is portal in React?
  • What are fragments in React?

HTML

  • How much do you rate yourself in HTML :D :D :D :D
  • What does HTML provide to do drag and drop? to which I only said I have used 3rd party libraries and never used the native solution provided by HTML.
  • Further question was how such libraries work behind the scenes and what code does it bring in to use HTML which I completely didn't know about.

Today's javascript interview questions. Honestly after giving many interviews I felt like this was a kiddy and useless interviews since I personally (don't know about generally) direct Google about such array methods to use. I pity and find it funny for myself that I couldn't answer upto the expectations, but because of the experience

I must say when someone asks you how much do you rate your self in this sexy tech library/feature you know its going to be a pretty bad interview.^(Doesn't apply to interviews in other countries I guess)