FE Interview Prep Takeaways Flashcards

1
Q

What is currying in JavaScript?

A

Currying is a technique in JavaScript and other functional programming languages where a function, instead of taking multiple arguments at once, takes a single argument and returns a new function that takes the next argument. This process continues until all arguments have been provided, at which point the final value is computed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is partial application in JavaScript?

A

Partial application refers to the process of fixing a few arguments of a function and generating a new function with a reduced number of arguments. Unlike currying, which is a way to apply functions one argument at a time, partial application allows you to set any combination of a function’s arguments, not just the ones in a specific order.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What should you set when submitting a form in HTML to specify where and how to send the data?

A

When submitting a form in HTML, it’s important to specify:

  1. Action Attribute (action): This sets the URL where the form data will be sent when the user submits the form. If omitted, the form data will be sent to the URL of the page containing the form.
  2. Method Attribute (method): This sets the HTTP method used when sending form data. The most commonly used methods are GET and POST. For secure or large data, it’s advisable to use POST.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Why should you avoid nesting <input> elements inside of <label> elements in HTML?

A

Avoid nesting <input> elements inside of <label> elements because some assistive technologies, such as Dragon NaturallySpeaking, do not support this structure well. This can result in accessibility issues for users who rely on such technologies to navigate and interact with web content.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the for...of loop in JavaScript and how is it used?

A

The for...of loop is a modern iteration statement in JavaScript that allows you to iterate over the values of iterable objects like arrays, strings, maps, and sets.

for (const element of iterable) {
  // code block to be executed
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do you fix the width discrepancy between textarea and input elements in CSS?

A

To make textarea and input elements have the same width, you can use the box-sizing: border-box; CSS property on the input element.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do you write a media query in CSS?

A

A media query in CSS allows you to apply styles based on certain conditions such as screen width, device orientation, and more.

@media (condition) {}
@media (max-width: 600px) {}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly