Software Engineering Rapid Fire Questions

Ace your homework & exams now with Quizwiz!

What is a web framework?

A web framework provides developers the tools they need in order to build applications.

Suggest one simple way of removing duplicates from an array.

Using Set() object. Here is an example of an array with duplicates and the use of Array.from() to return data as an array since Set()'s instance is an object. const array = [1, 4, 99, 3, 1, 4, 15]; const noDups = Array.from(new Set(array)); console.log(noDups); //[1, 4, 99, 3, 15]

Why arrow functions are different than regular JavaScript Functions?

Arrow functions are an improvement comparing to ES5 and prior, first because they are less verbose. You code less when using them. A second reason is the arrow function uses the 'this' of its lexical content. Losing the 'this' is a common scenario if you developed in ES5 and previous versions before. Though there are patterns to overcome it, ES6 offers 'off the shelve' solution. A common pattern to keep the reference to `myObj` context is to use `var self = this` in the desired context and keeping it available in the scope. var myObj = { run: function() { var self = this; return function() { console.log(self); } } } myObj.run()(); //it will log the myObj object, we kept the 'this' reference to the object. ES6, arrow function: We can skip the `var self = this;` and just return an arrow function. The latter will keep the reference to the desired 'this'. var myObj = { run: function() { return () => //notice the syntax. console.log(this); } } myObj.run()(); //it will log the myObj context and not window object.

Explain let, give an example of why it is fundamentally different than var?

Let was introduced in ES6. It mainly provides a way to declare and use variables in the block-scope. Var is function scoped meaning a variable declared using var is scoped to the entire function in which it was declared. How let is different from var is best explained by examples. access a variable before it is declared is possible with var: console.log(y); var y = 5; // undefined The y variable is hoisted and set to undefined and can be accessed by the log() call. It is not possible with let: console.log(y) let y = 5; // error- y is not defined the variable y is declared using let. It is only accessible to code that is 'below' it scope-wise.

What is an MVC framework?

MVC stands for Model-View-Controller, this essentially means that Rails takes advantage of the popular application architecture that helps developers naturally separate concerns and organize their applications properly.

What is Big O time?

The language and metric we use to describe the efficiency of algorithms.


Related study sets

Exploring Linux Filesystems (review questions) - [LINUX System Administration]

View Set

STRAT 5701 Week 5 - Cost Leadership

View Set

MENTAL HEALTH BOOK QUESTIONS EXAM 3

View Set

14.02 Functions of Cerebrospinal Fluid

View Set