Study
-
Control flowStudy/JavaScript 2020. 4. 29. 18:23
Control flow The control flow is the order in which the computer executes statements in a script. Code is run in order from the first line in the file to the last line, unless the computer runs across the (extremely frequent) structures that change the control flow, such as conditionals and loops. For example, imagine a script used to validate user data from a webpage form. The script submits va..
-
The switch keywordStudy/JavaScript 2020. 4. 29. 18:05
The switch keyword else if statements are a great tool if we need to check multiple conditions. In programming, we often find ourselves needing to check multiple values and handling each of them differently. For example: let groceryItem = 'papaya'; if (groceryItem === 'tomato') { console.log('Tomatoes are $0.49'); } else if (groceryItem === 'papaya'){ console.log('Papayas are $1.29'); } else { c..
-
String InterpolationStudy/JavaScript 2020. 4. 29. 10:26
String Interpolation In the ES6 version of JavaScript, we can insert, or interpolate, variables into strings using template literals. Check out the following example where a template literal is used to log strings together: const myPet = 'armadillo'; console.log(`I own a pet ${myPet}.`); // Output: I own a pet armadillo. Notice that: a template literal is wrapped by backticks ` (this key is usua..
-
Create a Variable: letStudy/JavaScript 2020. 4. 29. 09:54
Create a Variable: let As mentioned in the previous exercise, the let keyword was introduced in ES6. The let keyword signals that the variable can be reassigned a different value. Take a look at the example: let meal = 'Enchiladas'; console.log(meal); // Output: Enchiladas meal = 'Burrito'; console.log(meal); // Output: Burrito Another concept that we should be aware of when using let (and even ..
-
How to Remember Everything You're LearningStudy/공부방법 2020. 4. 29. 09:52
https://www.youtube.com/watch?v=aMzAjQ4uUag How to Remember Everything You're Learning 1 Focus on understanding -concepts : by understanding the underlying concepts and algorithms you will be able to code in multiple languages 2 Apply what you are learning through working on multiple projects . 3 View other people projects and codebase through git.... 4 Find a community to share collaborate to g..
-
Create a Variable: varStudy/JavaScript 2020. 4. 29. 09:39
Create a Variable: var There were a lot of changes introduced in the ES6 version of JavaScript in 2015. One of the biggest changes was two new keywords, let and const, to create, or declare, variables. Prior to the ES6, programmers could only use the var keyword to declare variables. var myName = 'Arya'; console.log(myName); // Output: Arya Let’s consider the example above: var, short for variab..
-
PropertiesStudy/JavaScript 2020. 4. 28. 22:11
Properties When you introduce a new piece of data into a JavaScript program, the browser saves it as an instance of the data type. Every string instance has a property called length that stores the number of characters in that string. You can retrieve property information by appending the string with a period and the property name: console.log('Hello'.length); // Prints 5 The . is another operat..
-
Data TypesStudy/JavaScript 2020. 4. 28. 21:49
Data Types Data types are the classifications we give to the different kinds of data that we use in programming. In JavaScript, there are seven fundamental data types: Number: Any number, including numbers with decimals: 4, 8, 1516, 23.42. String: Any grouping of characters on your keyboard (letters, numbers, spaces, symbols, etc.) surrounded by single quotes: ' ... ' or double quotes " ... ". T..