forked from LEARNAcademy/Assessments-2018
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Week-3.js
21 lines (11 loc) · 877 Bytes
/
Week-3.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
1. Write a simple React component that simply prints "I am a component" to the screen. Be sure to include all necessary imports, exports, etc...
2. Practice With Loops: In React, we often use the map function to iterate over an array held in state. To get more practice with this, write a vanilla javascript for loop that outputs the same thing as the map function below.
var stuffArray = [42, "Arthur Dent", 1978, "Zaphod", "Vogon", "Marvin, the Paranoid Android"]
stuffArray.map(function(el, i){
console.log(el + " is at index: " + i)
})
// your for loop here, you can use the same stuffArray array
3. Basic sorting: Find the cheapest price -- you are given a list of prices and need to find the signle lowest price from the array. Write a function that takes in an array of numbers, and returns the lowest price
var steal = function(){
// your logic here
}