Teh Codez Flashcards
(45 cards)
Webpack solves which fundamental problem?
bundling
What is the difference between /usr/bin and /usr/local/bin
/usr/local/bin is for locally compiled packages which upgrades may modify or delete without warning. /usr/bin is for distribution-managed programs.
Why use Webpack over a task runner such as Grunt or Gulp?
Webpack does all the preprocessing for you, and gives specified bundles based on configuration and the existing code.
npm: what is the difference between dependencies and devDependencies?
devDependencies are not installed in a directory with package.json with the –production flag. In other direcctories, they are not installed without the –dev flag. devDependencies are not installed transitively.
What is a source map?
A source map consists of information that can be used to map a compressed file back to its original sources.
Name several special characters in HTML.
& code ;
The shell: how do you go to the beginning of a line? To the end of the line? Delete everything right of the cursor?
CTRL-A, CTRL-E, CTRL-K
How do you provide a default file name for a downloaded file?
Place the name of the file in the download attribute.
What is a webpack loader?
A webpack loader is the equivalent of a task in most task runners. It preprocesses files as they are required.
How do you enforce order with webpack loaders?
Either use them right to left, bottom to top, or use the enforce flag in the rules, setting it either to pre or post.
Name two ways of passing parameters to loaders. Which is preferred?
Inline, and using the options object within the module rules. Options is preferred due to readability.
In webpack, how can you use more than one loader?
Place separate loader configurations in the use array.
Name at least four ways to blockquote HTML using tags.
blockquote, code, q, cite,
Name five tags for representing computer code.
code, pre, var , kbd, samp
What HTML tag is used to markup times and dates?
Use the time tag with the datetime attribute.
Describe how React’s event handling differs from HTML’s syntactically.
HTML inline will list the event in lower case, and set the event to the name of the method, with parentheses, between quotes. React will list the event inline to the name of the method, camelCase, between curly braces.
Can you return false to prevent default behavior in React?
No, you must call preventDefault explicitly.
What does the JavaScript bind() method do?
It creates a new function with the this keyword set to the provided value. If any other arguments are provided, they appear first in the new function. Habitually use bind whenever you refer to a method without () after it.
True or false: in JavaScript, class methods are bound by default.
False.
In React, how do you prevent a component from rendering?
return null
In React, describe a way you can conditionally render an element.
In curly brackets, use an expression with the && operator. The rhs will only render if the lhs is true.
Describe JavaScript’s map function.
An array function, it returns a transformed array by taking a callback which has three arguments, an array element, the array index, and a reference to the initial array. The return value of the callback is the updated array element. The initial array is unchanged unless the developer explicitly changes it.
Describe JavaScript’s filter function.
An array function, it returns values that return true for a given condition. It takes a callback and passes in three arguments, an array element, an index, and a reference to the initial array.
Describe JavaScript’s reduce function.
An array function, it takes a callback that has four arguments, and an initial value. The callback takes an accumulator, the current array value, the current index, and a reference to the initial array. When the initial value is not given, the accumulator defaults to the first value of the array.