This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For the most up to date information and installation process, | |
# go to https://neo4j.com/docs/operations-manual/current/installation/linux/debian/#debian-installation | |
# Get the debian package from neo4j | |
wget -O - https://debian.neo4j.com/neotechnology.gpg.key | sudo apt-key add - | |
echo 'deb https://debian.neo4j.com stable latest' | sudo tee -a /etc/apt/sources.list.d/neo4j.list | |
sudo apt-get update | |
# Installs neo4j | |
sudo apt-get install neo4j |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A function with no parameters and no return value | |
var myFunction = function() { | |
console.log("foobar"); | |
} | |
// Calling the function // | |
myFunction(); | |
// A function with 1 parameter and no return value | |
var myFunction2 = function(variable) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example Queue // | |
var queue = []; | |
// Enqueue the values // | |
queue.push(1); | |
queue.push(2); | |
queue.push(3); | |
// Dequeue and print the values // | |
console.log(queue.shift()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a "stack" // | |
var stack = []; | |
// Push values onto the stack // | |
stack.push(3); | |
stack.push(2); | |
stack.push(1); | |
// Print off the order that the values are in // | |
console.log(stack.pop()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Creates an array // | |
var array = []; | |
// Another way of creating an array of size 2 // | |
var objectArray = new Array(2); | |
// Creates an array with some data already in it // | |
var arrayWithData = [1, 2, 3, 4]; | |
// Adds a value to the array // |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create an array of fruits // | |
var fruits = ['Orange', 'Banana', 'Apple']; | |
// Loop through the values in that array | |
for (var fruit of fruits) { | |
console.log(fruit); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create an object car with some attributes // | |
var car = { | |
brand:"Honda", | |
year:2018, | |
kms:2500 | |
}; | |
// Loops through the attributes in the object | |
for (var attribute in car) { | |
console.log(attribute + ": " + car[attribute]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Initialize | |
var i = 0; | |
do { | |
console.log(i) | |
// Increment | |
i++; | |
} | |
// Evaluate | |
while (i < 10); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Prints out the values from 0 to 9 | |
*/ | |
// Initialization, Evaluation, and Increment | |
// all in one line | |
for(var i = 0; i < 10; i++) { | |
console.log(i); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This prints out the numbers from 0 to 9 | |
*/ | |
// Initialize | |
var i = 0; | |
// Evaluate | |
while(i < 10) { | |
console.log(i); |