{ "@context": "https://schema.org", "@type": "Organization", "name": "Brainscape", "url": "https://www.brainscape.com/", "logo": "https://www.brainscape.com/pks/images/cms/public-views/shared/Brainscape-logo-c4e172b280b4616f7fda.svg", "sameAs": [ "https://www.facebook.com/Brainscape", "https://x.com/brainscape", "https://www.linkedin.com/company/brainscape", "https://www.instagram.com/brainscape/", "https://www.tiktok.com/@brainscapeu", "https://www.pinterest.com/brainscape/", "https://www.youtube.com/@BrainscapeNY" ], "contactPoint": { "@type": "ContactPoint", "telephone": "(929) 334-4005", "contactType": "customer service", "availableLanguage": ["English"] }, "founder": { "@type": "Person", "name": "Andrew Cohen" }, "description": "Brainscape’s spaced repetition system is proven to DOUBLE learning results! Find, make, and study flashcards online or in our mobile app. Serious learners only.", "address": { "@type": "PostalAddress", "streetAddress": "159 W 25th St, Ste 517", "addressLocality": "New York", "addressRegion": "NY", "postalCode": "10001", "addressCountry": "USA" } }

questions4 Flashcards

(10 cards)

1
Q

What is strict mode in JS?

A

this is a mode that place some restrictions to your jS code for example it disables variable hoisting

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

What is the error in js?

A

Errors are statements that don’t let the program run properly. There 3 types : syntax errors, runtime errors, and logical errors

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

How to throw an error?

A

‘throw new Error’ syntax for errors with detailed information

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

How to handle an error?

A

try - wrap weird code that may throw an error in try block.
catch - catches an error
finally - code in the finally block will always be executed no matter is there an error.

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

How to work with the async error?

A

Promise has catch method it returns us the error from the failed async operation.

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

let and const, compare with var

A

var can be hoisted and it can be called outside of block scope.

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

Arrow functions

A

Arrow functions are always anonymous. ‘this’ refers to lexical/parent context

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

Template strings

A

string that gives more control over dynamic strings.
Template literal is created using the backtick () character scfss ${fff} ffvf`

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

Classes

A
Syntactical sugar. Classes are a template for creating objects. Class declarations are not hoisted.
Use class keyword to create a new class
Can be used with 'extends' keyword to make one class extended from another.
New keyword to create a new object based on class
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Symbols

A
It is a primitive type in JS. 
Symbols are often used to add unique property keys to an object.
Every Symbol() call is guaranteed to return a unique Symbol
let sym2 = Symbol('foo')
How well did you know this?
1
Not at all
2
3
4
5
Perfectly