Skip to content

Instantly share code, notes, and snippets.

View Mattteo1220's full-sized avatar
🎯
Focusing

Matthew McEntire Mattteo1220

🎯
Focusing
View GitHub Profile
For my crime map api, I will be utilizing a tool from spotcrime.com and creating a search parameter for people who want to know what their neighborhoods are really like while they are not watching. In essence, this gives people the info they need to make strong and informative decisions. This will also allow end-users to learn about different crimes committed and tips on how to spot, prevent and ultimately correct wanna-be criminals.
End-users will input their addresses of where they live or will live and through the search parameter passed in, a map will be rendered of the given location(s) and the crime that has been committed there.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="This is an API call.">
<title>Api Prac app</title>
<link rel="stylesheet" type="text/css" href="main.css">
</head>
<body>
<h1>Search Youtube Videos Via an API Call</h1>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>repl.it</title>
<link href="main.css" rel="stylesheet" type="text/css" />
</head>
<body>
<nav>
$(function makelight(){
$(".lightbulb").click(function(event){
$(".lightbulb").removeClass("bulb-on");
$(event.currentTarget).addClass("bulb-on");
});
$(function(){
makeLight();
});
})
function createMyObject() {
return {
foo: "bar",
answerToUniverse: 42,
'olly olly': "oxen free",
sayHello: function() {
return 'hello';
}
}
}
What is scope? Your explanation should include the idea of global vs. local scope.
Scope - how the Javascript intepreter finds and executes your variables. If they are local variables, then we have local scope within a function. A global variable is one found outside of a function just hanging out in the code.
Why are global variables avoided? - Global variables are avoided as the variable could be utilized inside many other files and or snippets of your code. This could alter your data.
Explain JavaScript's strict mode - this enforces good scope practice and makes you use "var" within your variable declaration.
What are side effects, and what is a pure function? -side affects are both good and bad. THe good is when changing data within a DB. Bad is when code changes. Pure function is when the function is written and executed appropriately.
Explain variable hoisting in JavaScript. - How the JS intepreter parses your functions and variables.
function main() {
try {
doAllTheThings();
}
catch(e) {
console.error(e);
reportError(e);
}
}
https://repl.it/G9Do/1
function computeArea(width, height) {
return (width * height);
}
/* From here down, you are not expected to
understand.... for now :)
https://repl.it/G8sD/76
function shouter(whatToShout) {
return whatToShout.toUpperCase() + "!!!";
}
/* From here down, you are not expected to
understand.... for now :)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">