Fix it! This should be an anchor tag with an id of clickme, that links to https://scripted.org/ with the text ScriptEd.
<a href="https://scripted.org/" id="clickme">ScriptEd</a>
Name the two variable declarations besides var
const and let
This is a reusable piece of code in react
What is a component
This data structure is a list of values
What is an array
var a = "false"
a is what type of data
A string
Write it! Give the following div a solid, red, 5-pixel border
<div class="danger">Caution</div>
.danger{
border:5px solid red;
}
import
This method inside a react component is responsible for displaying the content on the screen
What is the render method
This data structure is a list of key values pairs
What is an object
This is the value that this expression evaluates to
(1>2 || 5===5) && (true || false)
true
This css selector selects all the <a> elements inside a <p> element
p a {
}
This function is used to iterate over an array and return the resulting modified array
what is the map function
We use these to pass data from one component to another and allow us to customize components
What are props
This is where we persist data for an application
What is a database
Write it! Write the code that will print a random number between 1 and 5
var random=Math.random();
console.log((random*4) +1);
Name 15 types of html elements (will only accept one type of heading)
h1 a p ul ol li div img marquee br title head body script style i b span section main
var myFunction = () => {
return "hi"
}
is what type of function?
An arrow function
This allows us to keep track of data related to a specific component
What is state
Write the code to retrieve the value 42 from the object
var myData = {
one: [
{
two: [42]
}
]
}
myData.one[0].two[0]
What new city will Code Nation be in 2019
Chicago
This element is used to display content from another webpage in your webpage
What is an iframe
var name = "Joe"
var title = "manager"
var sentence = `${Joe} is a ${title} at Code Nation"
console.log(sentence
What will the following display?
Call a component called "Navbar" and pass it a prop called "title" with the value "My Site"
<Navbar title="My Site">
Write it! Write the code that will loop through the following array count how many times chocolate appears
var flavors= ["chocolate","vanilla","strawberry", "chocolate", "vanilla", "chocolate"];
var count = 0;
flavors.forEach(function(flavor){
if(flavor=="chocolate"){
count++;
}
});
console.log(count);
What NBA basketball player was a judge at the hackathon?
Smush Parker