logged out
Dark Mode
Show all answers
About
All
OOP
NB
Arrays
Functions
Acronyms
Objects
Data Structures
Networking
Database
CSS
test
test2
Basics
Reveal answer.
What is a block statement?
id:60
Block statements such as if, while, for and switch do not create a new execution context. Contrary to the var keyword, let and const do create local scope inside block statements.
CSS
Reveal answer.
What is the difference between margin and padding?
id:76
Padding is included within the click region and background color/image, but margin is not. Vertical margins auto collapse, but paddings do not. Consider two elements, one above the other. If both have a padding of 1em, they will be 2ems apart. However if both have a margin of 1em, the margin will auto collapse, resulting in them being only 1em apart.
Arrays
Data Structures
test
Reveal answer.
What does it mean to flatten an array?
id:153
Flattening an array means to take an array of nested arrays, ie a multidimensional array, and reduce it to a single dimension array. arr1.flat(2) The flat method takes as an argument the depth of dimensions which need to be flattened.
Data Structures
Reveal answer.
What is a weakmap?
id:167
A weakmap is a collection of key value pairs, in which the key must always be an object. A WeakMap is a map (dictionary) where the keys are weak - that is, if all references to the key are lost and there are no more references to the value - the value can be garbage collected.
Acronyms
Reveal answer.
What are XSS attacks?
id:128
Cross site scripting.
CSS
Reveal answer.
What is semantic html?
id:77
A semantic element clearly describes its meaning to the browser and the developer. Header, footer, nav, aside, section, main, article, table. Non semantic - div, span, What is the box model? A web browser renders elements as a rectangular box. The size of this box depends on the css properties of its content, such as the content itself, the margin, border and padding.
Acronyms
Reveal answer.
What is CRM?
id:124
Customer relationship management software
Objects
OOP
Reveal answer.
Explain the “this” keyword?
id:140
The ‘this’ keyword refers to the object that the function is a property of. function dosomething() { console.log(this) // window object in a browser } dosomething(); In the above example the function is a property of the window object ie the global object. When a function is invoked, the object before the dot is the value of this. If there is no object before the dot, the value is the global object.
OOP
Reveal answer.
What is inheritance?
id:28
Inheritance is a way to reuse existing code. A derived class inherits from a base class, such that the derived class will have access to the base classes attributes and methods.
Functions
Reveal answer.
What is a predicate function?
id:48
A predicate function is a function which returns a boolean, either True or False.