What’s the code to print in the browser’s console?
console.log(“Hello world”);
JavaScript variable syntax
- String \+ var firstName = "james"; \+ Always put var first. Strings are inside "". - Numbers \+ var age = 32;
What is the replace method?
What is the append method?
//jQuery $( ".inner" ).append( "<p>Test</p>" );
//Result in the html
<h2>Greetings</h2>
<div class="container">
<div class="inner">
Hello
<p>Test</p>
</div>
<div class="inner">
Goodbye
<p>Test</p>
</div>
</div>- You can also select an element on the page and insert it into another:
//jQuery
$( ".container" ).append( $( "h2" ) );What is the prepend method?
Function Syntaxis?
var udacityizer = function(s) {
s = s.replace("au","U");
return s; };6 Falsy values
Array Syntaxis
for Syntaxis
object Syntaxis
//Acess bio name bio.name
//Adding properties to obj 1 bio.city = "Bogota";
//Adding properties to obj 2 bio["city"] = "Bogota";
What is JSON?
How to lint my JSON?
JSON object example
var education = {
"schools": [
{
"name": "university",
"major": ["compu", "bio"]
},
{
"name": "university",
"major": ["compu", "bio"]
},
]
};What is the DOM?
Bracket notation