Stand In Line is a CheckPoint where you're supposed to:
Write a function nextInLine
which has two parameters
an array (arr
) and a number (item
).
That part has been done for you here:
function nextInLine(arr, item) { }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
<head> | |
<title> | |
Joseph A. Tracy's Assignement Three | |
</title> | |
<meta http-equiv="content-type" content="text/html;charset=utf-8" /> |
// Record Collection: (I have added the instructions to the comments.) | |
// First we need to understand that collection is an object with children objects. | |
// collections is an object with 4 properties: 2548, 2468, 1245 & 5439 | |
// Each of those object properties have a child object. | |
// Those child objects can have up to three properties: album, artist & tracks | |
// Of those album & artist are strings and tracks is an array. | |
// Write a function which takes an album's id (like 2548), | |
// a property key (or name) ... prop (like "artist" or "tracks"), |
Stand In Line is a CheckPoint where you're supposed to:
Write a function nextInLine
which has two parameters
an array (arr
) and a number (item
).
That part has been done for you here:
function nextInLine(arr, item) { }
Gist for the FreeCodeCamp Profile Lookup Challenge. Instructions as comments. Total: 39 lines.
We have an array of objects representing different people in our contacts lists.
Example: var contacts = [ { ... } , { ... } , { ... } , { ... } ];
// A lookUpProfile function that takes
// firstName and a property (prop)
/* FreeCodeCamp - Nesting For Loops Challenge. | |
Total: 75 Lines on Gist. | |
Before we get into the challenge instructions and process, | |
I'd like to have an extended review for Accessing Complex Arrays & | |
iterating across arrays using for loops. Then we'll move into the complex arrays. | |
For this process, let's first create an array: | |
var arr = ["B", "D", "F", "H", "J", "L"]; // Even letters. | |
To access "B" we use arr[0]; and "J" is arr[4]; |
My recommended learning resources for web development. (Note this may be a little too much.) | |
This is over 80 lines of text. | |
This is a good video: | |
How to Become a Master Web Developer | |
https://www.youtube.com/watch?v=0yzRW8yqN4M | |
2016/2017 MUST-KNOW WEB DEVELOPMENT TECH - Watch this if you want to be a web developer | |
https://www.youtube.com/watch?v=sBzRwzY7G-k 22:51 |
Side Question: | |
```js | |
function getName() { return "Happy Feet"; } | |
var name = getName(); | |
console.log(name); | |
``` | |
What do **you** think is output to the console when you log the variable `name`? | |
Why do you think that is? ... How does that relate to your question and to the challenge that you're working on? | |
Strings are Immutable. You have to completely reassign the string or create a new string. |
Convert Celsius to Fahrenheit
To test your learning, you will create a solution "from scratch". Place your code between the indicated lines and it will be tested against multiple test cases.
The algorithm to convert from Celsius to Fahrenheit is the temperature in Celsius times 9/5, plus 32.
You are given a variable celsius representing a temperature in Celsius. Use the variable fahrenheit already defined and apply the algorithm to assign it the corresponding temperature in Fahrenheit.
Note:
Accessing values in Objects.
Dot Notation is converting the value to a string (string literal). Example: myObj.name;
is the same as myObj["name"];
and as we all know quotes define strings.
If you want to use a variable for accessing the value of object properties you cannot use Dot Notation. You have to use Bracket Notation. Example: var num = 42;
myObj[num];
There are a few other limitations when accessing an object property. If the object key has a space or number in it, you cannot use dot notation.
var myObj = {