C11 Written Assessment – Updated


System/OS, Environment, GIT


What is an operating system?
The operating system, short for OS, is the software that a computer runs on and communicates with the hardware on how to execute programs and applications. Apple has a proprietary OS called Mac, PC users have Windows, Unix or Linux and perhaps there are others.


What is a GUI?
GUI stands for Graphical User Interface and it is the visual representation of data and file structures that you see on your computer display. 


What is a development environment?
A development environment is the various tools and processes a developer uses to program software and other code.


What does IDE stand for?
Integrated Development Environment and it assists you in writing code with various features versus writing code in a plain-text editor.


In MacOs, what is a Terminal? 
A terminal is where you can write commands to directly communicate and execute various functions in your computer without having to use the GUI.


In Windows, what is a Command Prompt?
Similar to terminal, this is where you would write command lines to communicate with your computer, but it has a different name specific to Windows.


What is a shell?
A shell is a program that reads commands and runs programs - it is an interface between the user and Operating System. It is a command line interface.


What is BASH?
BASH is a command-line shell, stands for “Bourne again shell” and came as a replacement for the Bourne shell, which was one of the first Unix shells. It is the default in Linux and Mac OS X applications.


What is Zsh?
Zsh is also a shell like BASH, however it is an interactive shell that incorporates a lot of useful features from other shells including auto-completions, spell correction, path replacement and more.


What is SSH?
SSH, aka Secure Shell, is a shell that automatically encrypts data sent by a computer to a network and is used for network security.


What are dotfiles?
Dotfiles are hidden files that have configurations for settings, themes and other processes.


What are permission?
Permissions give access to certain users depending on their role and are given by the admin of a site or system.


What is an absolute path?
A file pathname that starts from the system root directory.


What is a relative path?
A relative pathname tells the location of a file relative to the current directory it is in.


What does CLI stand for?
Command Line Interface


How can the current directory be identified using the command line?
pwd which stands for ‘print working directory’


How can the contents of a directory (current) be viewed?
Typing in ls which s used to list files and directories.


What command must be used to make a directory or folder using the CLI? 
mkdir (make folder)


How can recent commands be viewed on the command line? 
By using the up or down arrows on your keyboard to browse through the recent history of command lines


What shortcut keyboard combination can be used to automatically complete a path in the 
commands line? 
You use the tab key


How can a local server be started and stopped (state actual commands)? 
Python 2: python -m SimpleHTTPServer 8000
Python 3: pythom3 -m http.server —cgi 8080
PHP: php -S localhost:2222
npm: nom i -g serve
serve


What naming convention can be used to save an application or program? 
-name consistently, short but descriptive, avoid special characters or spaces, use capitals and underscores instead of periods,spaces,slashes, use a standard dating format,etc.


What is GIT?
Git is software to generate repositories.


How is GIT distinct from a repo service like Github or Bitbucket? 
GIT is the software used to communicate and manipulate files to and from a repo service, not the service itself. 


Name at least one other version control technologies (other than GIT).
CVS, SVN, Mercurial and Bazaar


What is the command to initialize a GIT repo?
git init 


What is the difference between staging and committing in GIT?
When staging, you are telling GIT to hold changes prior to committing them to the repo. Only staged changes will be able to be committed to the repo, so this is an important step to do when making version control changes. 


What is the difference between an untracked and tracked file in GIT?
tracked files are ones that are staged and committed, untracked files are ones that exists locally but not part of the Git repo and have not been staged or committed.


What is the difference between the npm init and git init commands? 
npm init generates a package.JSON file to the NPM repo in Node.js and git init creates a .git subdirectory in the current working directory


Workflow, Dev Tools


What is meant by the phrase developer workflow?
This describes the various tools and processes a developer may use to execute projects from start to finish.


What is a code/text editor? Give an example?
A code editor is a platform that allows developers to write and store code sometimes containing built-in features used to deploy the code to repos. Examples include Atom and Sublime, VS Code.


What are the Chrome and Firefox developer tools? List examples of ways they can be used.
These are tools built into the browser that assist in development. Examples include Page Inspector to inspect elements on a webpage, Web Console to view the code logged into the console running in realtime. Javascript Debugger to help debug the code and various other tools that help analyze performance and activity of the code.


List three resources that can assist you in your coding journey (hint: resources for 
troubleshooting or to better understand a concept).
stackoverflow.com, w3schools.org, MDN web docs


What is a local server and why would one be used?
A local server runs applications on the same machine as the application, such as your computer. It is helpful in providing the same environment as your web host’s server.


How can you install and run code using a local server? 
You can use an all-in-one application to install the web server, database server and language such as XAMPP or MAMP. 


What is Node? 
An open source Javascript environment that execute code outside of a web browser.


What is NPM? Give an example of a module that can be downloaded and installed from NPM. 
NPM is Node Package Manager, modules are JavaScript libraries you can include in your project such as  jQuery. 


List one text editor that can be used in lieu of an IDE. How can a library like P5 (p5js.org) be run
without using the P5 web editor? 
You can use Notepad++. You can use the Processing IDE to run p5 code without a web editor.


What is Slack? 
Slack is a web-based collaborative workspace that is meant for teams. You can share and organize files, have conversations, start threads and direct messages with others on your team.


What is Zoom?
Zoom is a web-based digital conferencing software application enabled through live-streaming.


What is the difference between VS Code and Visual Studio?
Visual Studio is a full IDE meant for .NET development and VS Code is a text-editor with lots of optional plugins similar to Atom or Sublime.


What is meant by a development environment?
This refers to the processes and tools needed to create code or programs. This is sometimes synonymous to IDE and involves development of code not seen to the client.


What is meant by a production environment?
The production environment is where the actual changes to code go live and are visible to the client and user. It is where the product operates live on the web and you can roll-out changes to particular users as a way to gradually make updates.


What does it mean to debug a program?
This is the process of finding problems and issues in the code through analyzing segments using console.log.


What is console.log()? 
console.log() is a built-in function within the code that enables you to see the processed results of your code snippets wherever it is called.


How can console.log() be used to debug a program/line/lines of code?
You use this tool to verify whether your code is working the way it is intended to by seeing the results, or to otherwise create alerts in your code if it is not working properly.


CMS, Static Deployment


What is WordPress?
Wordpress is a PHP-based blogging platform and Content Management System.


What is Github Pages?
GitHub Pages is a free hosting platform for web pages.


What is Netlify?
Netlify also offers hosting through cloud computing and server less backend services meant for more productive and rapid deployment of websites.


What is Jamstack?
This stands for a modern web development architecture based on JavaScript, APIs, and Markup and streamlines workflow by providing a simpler developer experience.


How can a web application be deployed (hint: consider services)?
You can use git+github+github pages to deploy your code, other hosting platforms and various IDE’s that have built-in features to get your site up. Also Netlify and Jamstack as mentioned above, which streamline these processes.


Which path currently interests you from the 2020 Developer Road Map?
Front-End Development the most for now


The Internet/The Web


In your own words, what is the Internet and how does it work? 
The internet is what describes the process of a network of computers interacting through communications technology including worldwide servers that store data and share data between these machines. 


What is the difference between the Web and the Internet?
The internet is more in reference to the hardware and global connections between the computers and servers and the web is the collection of information and data accessed through browsers interacting with the internet.


What is a client? 
A client is either a personal device such as a computer or browser that you access applications with. It receives and then uses data from local or remote servers by making requests.


What is a server?
A server is a physical device or software program that runs services to serve the needs of other computers and typically stores mass information and data needed to run applications. Servers send information to clients upon request. Servers that power most of the internet as we know it, largely exist in a collection as seen in big server farms.


What is HTTP? 
Short for, Hypertext Transfer Protocol, is the protocol of rules that clients and servers use in order to transmit data between them.


What is DNS?
Known as the ‘phonebook of the internet’, DNS, short for Domain Name System, designates domain names to various IP addresses and makes them more readable to humans. Examples include google.com, facebook.com, wikipedia.org


What is an IP address?
Short for Internet Protocol address, this is the number used to identify requests made by the user making the browser and is responsible for addressing, routing, and delivering all of the online requests and activity. 


What is an internet connection?
Connecting to the internet requires connection to a server hub in your region before data can be transmitted to a user’s device, which is facilitated through an Internet Service Provider or ISP for short. Telecommunications companies such as Verizon, Time Warner, Spectrum and others provide the means to make these connectionse for consumers so they may access the internet. There are many different ways to obtain internet access through various ISP services, including:
Wireless connection such as 4G and 5G, Mobile connection, Hotspots, Dial-up, Broadband, DSL, Fiber Optics & Satellite.


What is TCP/IP?
Also known as Transmission Control Protocol/Internet Protocol, TCP/IP is instrumental in specifying how data is exchanged through the internet by providing end-to-end communications that identify how it should be broken down into packets, addressed, transmitted, routed and received at the destination.
 
What are packets?
Packets are used to transmit data through the internet through a packet-switching/packet-routing network. Various devices on a TCP/IP network divide data into small pieces, known as packets, allowing the network to accommodate various bandwidths, to allow for multiple routes to a destination and allowing the network to pick the most efficient route for the data. A packet is made up of two parts - a header, which tells the packet where it is going and other formatting instructions and of the data the packet contains.


HTML


What is HTML?
Short for Hypertext Markup Language, HTML is the language used to display the structure of webpages on your browser.


Why is it important?
HTML is the organizational backbone of the various features seen on webpages. With HTML, we are able to add and format content needed for applications. It works alongside other programming languages to provide modern and rich web experiences.


Give an example of a basic HTML file structure?
<html>
  <head>
    <title>My page title</title>
  </head>


  <body>
   <header>
      <h1>Header</h1>
    </header>


    <nav>
      <ul>
        <li><Home</a></li>
        <li>Our team</a></li>
        <li>Projects</a></li>
        <li>Contact</a></li>
      </ul>




CSS


What is CSS? 
Short for Cascading Style Sheets, CSS is a sheet language that adds styling to the various elements on a webpage, from images to text, colors and fonts, backgrounds, spatial design between elements and much more.


How can CSS be used in a web site/application?
CSS is used to add graphic design to a webpage or application, and in effect it can be instrumental in the design of the user interface in making an application aesthetically sound and pleasing to the user.


JavaScript and Programming Principles


What is JavaScript? 
JavaScript is a programming language that works on the client side to add functionality to webpages and other software. It helps create interactive environments by providing a bridge between the visual interface and the data used in the application. 


Where is the console (list all locations that apply) and what is it used for? 
The console is located on web browsers in their developer tool menus and in various text editors and IDE’s made for code. The console is used to debug code and otherwise display any errors in the code.


What is an expression? Give an example.
An expression is a statement that evaluates to a single value.
ex. 10; // evaluates to ten
ex. a===10 && c===30; //evaluates to true or false 


What is a statement? Give an example.
A statement is instruction to perform a specific action, and javascript programs are typically expressed as a sequence of these events.
ex. console.log(message);
ex. let var = 2;


What is the general syntax and structure for a block of code? Use code to demonstrate your 
response. 
We use literals with variables to store values, camelCase to indicate multi-word declarations, indentation to demarcate code snippets, “” to display string values and typically semicolons to run a line of code.


ex. let variableName = 10;
       if (variableName > 10) {
      console.log(“You have a number bigger than ten!”);
} 


Why are certain words in different colors in a text/code editor? 
This makes it easier for developers to know what different elements of code they are working with and makes the code more legible.


What is a system or reserved word in a library, framework or API (for example in P5)? Give an 
example. 
These are words that are reserved to process code given whatever language and cannot be used as identifiers or keywords modified by the user.
examples include function, else, if, eval


How does order matter in JavaScript? Give an example demonstrated with code. 
//typically declarations go on top
let var = 4;
//conditional logic or functions go below
function addNum () {
if (var >= 4) {
let addFour = var + 4;
}
}
//you can invoke functions here
addNum();
//then console.log or another command to display result
console.log(addFour);


What is the difference between a method and a boolean variable? 
Use code to demonstrate your response.
(hint: explore p5js.org)


Typical booleans are primitive values created from literals, and can either be true or false:
ex.
var x = false;
var y = true;
—————————————
A method is a function that is the property of an object.
ex.
let user = {
  name: "John",
  age: 30
};


user.sayHi = function() {
  alert("Hello!");
};


user.sayHi(); // Hello!




What is the difference between an inline comment and a block or multi-line comment? Use 
code to demonstrate your response. 
// This is how you block out an inline comment
/* This
blocks
out multiple 
lines
of
text  */


Does whitespace matter in JavaScript? Capitalization? Use code to demonstrate your response.
 
Yes, sometimes your code will not work properly if there is an incorrect amount of white spaces or incorrect Capitalization between certain characters. 


Let Var = 2;   - incorrect, will not work
let var = 2; - correct will work


let thereWillNotBeASpace = 2+’hello’;
// prints 2hello
let thereWillBeSpace = 2+" hello!”;
// prints 2 hello




Variables, Operators, Logic


What is a variable? 
Variables in JS are used like nouns, they come before an equal signs to represent a value and are often though not always used with keywords to describe how they will be used. let before a variable indicates the value may change and const before a variable will indicate that the value will not change.
Ex. 
age = 30;
let age = 31;
const age = 25;


What is a data type? 
Data types tells computers how the programmer wants to use the data. 
Ex. Numbers, Booleans, Strings, Undefined & Null
What is a value? 
A value is the indicated data type use to represent variables, or to denote the value of a key or parameter.


What is the difference between a system or reserved variable and one that you define? Use code
to demonstrate your response. 
let x = 4;  // x is a variable you can use because it is not used for variables, labels or function names.


let if = 4  // if is not a variable you can use, because it is reserved for conditional logical
const return = 4; // return is not a variable you can use because it is used to call return values from functions.


What is scope and how does it impact code? Use code to demonstrate your response.
Scope is the idea in programming that some variables are accessible/inaccessible from other parts of the program.


var g = 100;


function outer() {
    var x = 99;


    function inner() {
        var y = 77;
    }
}


The code inside the inner function has access to all three variables. The code inside outer can only access g and x, and the code outside of the outer function can only see g.


What does it mean to declare, initialize and use a variable? Use code to demonstrate your 
response. 
Declaring a variable is necessary in code so that you could use it in the program. 
To initialize a variable in order to declare it, you add an equal sign to the right of the variable name and write an expression. 
let var = true;
const age = 45;
let arrayName = [peaches, fruits, everything else];


What happens when a variable is attempted to be accessed outside of its scope?
It will not be accessible and therefore not usable. Your code may return an error or do nothing at all.
What happens when a variable is declared globally, but is not used?
Nothing if it is not being called or used, it will sit declared but not function.
What value does let nums; have?
It will register as undefined as the variable has not been declared with a value.
What are operators? Use code to demonstrate your response using at least one operator.
An operator is a character that represents an action between two operands. Operators include arithmetic, comparison or assignment operators, and logical operators such as +, -, *, %, ++, —, +=, &&, || + more.


ex. let w = 4;
w += 1;  // this operator both adds a value of 1 to w and assigns the new value to w.


What is a boolean data type?
The boolean data type stores true or false data values. 
ex. true or false, 0 also represents false and 1 represents true in the use of integers


List three examples of primitive data types.
Number = 4, 4.15, 777
String = “hello”
Boolean = true/false/0/1


Write a code example that increments a value by 7.
let x = x + 7;


Describe the order of operations for: y = size * 144 /12-53;
PEMDAS 
size multiplies by 144
multiplied value is then divided by 12
divided value is then subtracted by 53
y = calculated value


Write a code example that multiplies an expression by twenty two using shorthand.
x *= 22; // multiply x by 22 and assign new value to x.


What does the logical operator ! do? 
The ! operator denotes the logic of ‘not’ to whatever you are comparing.
x !== y // meaning x is not equal to y


Control, Iteration, Structure 


What is an if statement? When should it be used? Use code to describe its syntax. 
An if statement creates conditional logic to process your code. It should be used when you want to have various outcomes depending on conditions you set on the variables and values present in the code.


if (x >= 21) {
 // then whatever code you have in here will run;
}


How many if statements can you use? What is an alternative to the if statement? 
You can only use one ‘if’ statement for each condition, but you may use as many ‘else if’ statements if you would like to add more conditions. 
What is the difference between else and else if? Use code to demonstrate your response. 
Else statements run designated codes if the conditions outlined in the if and else if statement are not met. Else if creates different conditions, whereas else executes the option if none of the conditions created by the if and else if statements listed above it are met. 


let x = 5;
if (x=1) {
 // run whatever code;
} else if (x !== y) {
 // run another segment of code;
} else {
  // run this code if above conditions are not met 
}


What is the difference between code with several consecutive if statements and code with 
several else if statements? 


With several if statements, each statement’s condition will be checked even when a previous statement is true. With multiple else if statements it will check multiple conditions based on the evaluation of the previous statement, the conditions will stop being checked when a statement is true.


What is a while loop? When should it be used? Use code to describe its syntax.
A while loop creates a function that will loop (or continue) the execution of a specified statement as long as the test condition evaluates to true. You can use while loops to count or sort through data types found in arrays and objects, or to generate elements based on the conditions as long as the loop is running.


let n = 0;
while (n < 3) {
  n++;
}
console.log(n);
// expected output: 3


What is a for loop? When should it be used? Use code to describe its syntax.
A ‘for loop’ is very similar to a while loop and essentially does the same thing but it is used when you want to write shorter code as the conditions and operator function are written in the same line instead of separately like in while loop. 


for ( i = 0; i < 4; i++) {
 // execute code until the above condition is not true anymore
}
What is an infinite loop? Give an example using code. 
An infinite loop is a code that does not stop executing because the conditions that are set forth allow it to run forever. This is something to be careful of, as infinite loops can crash your program.
Ex. for (var i=0; i<Infinity; i++) {
}


How can you prevent an infinite loop?
By making sure the conditions have a logic that will enable it to end the execution of the code. Do not rely on user input to enter a specific value to end the loop. Avoid creating variables that do not have a set value of the loop counter. 


Pick one: Write code that uses a nested for loop to: 
1.) draw a grid of squares across the x and y axis of a canvas using p5js.org.


function setup() {
  createCanvas(600, 400);
}




function draw() {
  background(0);
  strokeWeight(4);
  stroke(255);




for (var x = 0; x <= width; x += 50) {
    for (var y = 0; y <= height; y += 50) {
      fill(255, 255, 255);
      rect(x, y, 25, 25);
    }
  }
}


2.) log to the console the characters x and o in a grid of alternating columns and rows.


Functions/Methods


What is a function?
Functions are subprograms that exist within your code in order to break up your code into smaller bits and avoid repeating the same code over again. They can perform a wide array of operations and can be used repeatedly by invoking and calling one by its name in different parts of your code.


What is the difference between a system function/api method one that you define? 
System functions are built-in to whatever programming language one is using, they cannot be modified and often perform simple and common tasks. User defined functions are created at the time of coding and can include many different tasks custom to the application needed.


Write a function that you define, one that includes parameters and one that does not include 
parameters. Include how the defined function would be used/called:


Function with Parameters
This function takes the parameters of my first name and last name when the function is called at the bottom of the code. When the function is invoked, it prints out the string “My name is Magdalena Krzyzanowski” to the console.


function myName (firstName, lastName) {
console.log('My name is ' + firstName + ' ' + lastName);
}
myName(‘Magdalena’,'Krzyzanowski');


Function without Parameters
In the function below, I am coding an ‘attack’ action that would lower the ‘Life Force’ of a character in the fighting game by 5%.


 // set initial LifeForce to 50
let lifeForce = 50; 
// enemyAttack deals a value of 4
let enemyAttack = 4; 


function attack () {
// using a condtional below to determine equality of the variable  and then a shortcode arithmetic/assignment operator to lower life force to 35%.
if (enemyAttack >= 4) {     
lifeForce -= 5;  
 console.log('Attack lowered your life to ' + lifeForce + ‘%!');     
}
}
attack (); //when attack(); is called, it lowers the lifeForce by 5% and prints ‘Attack lowered your life to 35%!’ to the console.




What does the keyword return mean?
 return stops the function from executing and stores the value of the function to be used in other parts of your code such as a new variable declaration.


Write code that uses the keyword return:
function multiplyByFive(x) {
return x * 5;
}
console.log(multiplyByFive(4));
//Function returns a value of of the parameter multipled by 5, evaluates to 20 and is called to be printed into the console log, which prints out the evaluation of 20.




What is the distinction between a function and a method?
A method, like a function, is a set of instructions that perform a task. Methods are used with objects in Object-Oriented Programming, whereas functions can be used anywhere in your code. However, you can easily turns methods into functions and vice-versa.
 
What is the distinction between argument and parameter?
Parameters are the inputs to the functions expressed as variables.
Arguments are values that are passed through these inputs when the function is invoked.


What do the () in a function call or definition indicate?
It is between these parentheses that a function’s parameters are declared if the particular function has parameters.


What will happen if you call an undefined function?
A function with an empty or non-existent return statement returns undefined, and will not store any value.


What will happen if you define a function, but do not call or use it? 
Nothing, you need to call or invoke it so that you can use it. 


What concept is a function useful for? 
D.R.Y. coding 


Objects/Classes, Arrays


What is an object? Objects are containers that include data sets comprising of key-value pairs and methods.


What is the data type in this example:  Object
let dog = {
name: “Fido”,
age: 12,
coat_length: “short”,
coat_color: “brown”,
bark: function() {console.log(“Woof! Woof!”);} } 


Using the example above, how can properties and methods of an object be accessed? 
You can access properties and methods of an object by using dot notation. Ex. 
dog.bark; 
//Accesses the method found in the bark key of the Object dog.
dog.name;
//Accesses returns the value “Fido”




What concept are objects, classes/constructors useful for? 
OOP, and Syntactic Sugar


What is the difference between an object and a class/constructor? Use code to demonstrate your
response. 
Objects are very useful as structures for storing related data and functionality, and classes/constructors are related as they help build new objects without having to manually input each data set every time you want to make a new object.


var lunch = {
sandwich: 'turkey',
drink: 'soda',
chips: true
};


var Lunch = function (sandwich, drink, chips) {
this.sandwich = sandwich;
this.drink = drink;
this.chips = chips;
};






What is the difference between a method/function attached to an object and one attached to a 
class/constructor? 
Methods attached to an object literal will only be available within that object literal  - however if you use a method in a constructor, each time a new object is created, the method will reproduce to each new object.


What is dot syntax? 
It is similar or the same thing as dot notion and is used to access properties and values in objects, as well as applying methods to specific parts of the objects. 


What is the keyword new used for?
The new operator is used to create an instance of an object which has a constructor function.
When we call the constructor function with new, we automate the following actions:
A new object is created
It binds this to the object
The constructor function’s prototype object becomes the __proto__ property of the new object
It returns the object from the function


What is a constructor? 
The constructor method is a special method for creating and initializing an object created within a class.


Where and when is a constructor/class used? Use code to demonstrate your response. 
The constructor() method is called automatically when a class is initiated, and it has to have the exact name "constructor", in fact, if you do not have a constructor method, JavaScript will add an invisible and empty constructor method.


class Car {
  constructor(brand) {          // Constructor
    this.carname = brand;
  }
}
mycar = new Car("Ford");


What is the keyword this used for? 


When you create your constructor function, you can use the “this” keyword to reference the object that will be created when the constructor is instantiated.
Organize original code to include the main program in one file and a class or constructor in another. Use in-line comments to walkthrough code and explain how to link the files. Be mindful of naming conventions.. Include a screenshot or shared link to an example.
https://repl.it/@studiosemantica/WinterMenu


What is an array?
An array is a list of the same data types, such as strings or numbers and is represented and initialized with a variable.


What is an array used for?
An array is used to store multiple values in a list and can be referenced as a value in function parameters, a value within an Object’s key-value pair and other places.  


What notation is commonly used to denote an array? 
Bracket Notation.
Ex. 
arrayName = [‘this’,’array’,’exists’,’within’,’brackets’];


What are the characteristics of data types in Javascript arrays? 
They have to be the same - you can use objects if you wish to store various data types together at the same time. 
What is an index? 
Items in an array are stored in sequential order. Each element has an index — a number that tells us the position in the array at which the element can be found.


What does 0-based index means in association with JavaScript arrays?
Indices allow you to access and update array values. Javascript is zero-based, meaning it’s number starts at 0 instead of 1.


Write code that declares, initializes and accesses elements in an array. Use comments to 
walkthrough code. 


const animals = []; //declares the variable animals as an array
const animals = ["camel", "dog", "lizard", “cat”]; //initializes the array by adding content
let dog = animals[1]; //accesses the index position of 1, which is “dog” in the animals array and then stores it in a variable called dog




List two or three methods or properties that can be called on an array. Describe how they 
manipulate the array.
.push( ) - adds a new user-defined value to the end of an array   ex. animals.push(‘cows')
.pop( ) - removes the last value from the array   ex. animals.pop()
.unshift( ) - adds a new user-defined value to the beginning of an array  ex.   animals.unshift(“monkey”)


What is a class? How is it distinguished from a constructor function?


It's a new standard in ES6 where using class allows you to to group the declaration of your object and its content in a block. The constructor initializes objects of the class defined but does not specifically belong to a class.  Any object created from the constructor will have the same defined properties as others of its class.


What are the keywords let and const? How are they distinct from var? 
let initializes a variable and allows for the variable to change in value.
const initializes a variable but does not allow the variable to change in value.
var is an outdated form of syntax and not used as much anymore, but will initialize a var like the prior two keywords.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s