JavaScript Flashcards

1
Q

How many threads has JavaScript and what does it mean?

A

JavaScript is single-threaded, meaning that two bits of script cannot run simultaneously; they have to run one after another.

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

Does JavaScript have its own thread?

A

JavaScript shares a thread with a load of other stuff that differs from browser to browser. But typically, JavaScript is in the same queue as painting, updating styles and handling user actions (such as highlighting text and intersection with form controls). Activity in one of these things delays the others.

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

Is JavaScript sync or async?

A

JavaScript is an asynchronous and concurrent programming language that offers a lot of flexibility. It’s single-threaded like synchronous but also non-blocking like asynchronous.

Although it’s synchronous by nature, JavaScript benefits from an asynchronous process.

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

What is an asynchronous architecture?

A

Asynchronous is a non-blocking architecture, so the execution of one task isn’t dependent on another. Tasks can run simultaneously.

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

What is a synchronous architecture?

A

Synchronous is a blocking architecture, so the execution of each operation depends on completing the one before it. Each task requires an answer before moving on to the next iteration.

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