This file contains 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
const object1 = { | |
a: 'NO', | |
b: 'NO', | |
c: 'Yes', | |
d: 'NO', | |
}; | |
//console.log(Object.values(object1)); | |
function getWordCount(array) { |
This file contains 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
const person = [{ | |
firstName: 'John', | |
lastName: 'Doe' | |
}, | |
{ | |
firstName: 'John', | |
lastName: 'Doe' | |
}]; | |
var propertyValues = [];//Object.values(person[0]); |
This file contains 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
function setMarkers(map) { | |
var bounds = new google.maps.LatLngBounds(); | |
for (var i = 0; i < restaurants.length; i++) { | |
var restaurant = restaurants[i]; | |
var layerposit = (restaurant[4] == 1 ? 999 : restaurant[3]); | |
var marker = new google.maps.Marker({ | |
position: { | |
lat: restaurant[1], |
This file contains 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
Usage: | |
# Checkout an existing branch | |
$ git checkout <branch_name> | |
# Checkout and create a new branch with that name | |
$ git checkout -b <new_branch> | |
In Practice: |
This file contains 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 new branch | |
$ git branch <branch_name> | |
# List all remote or local branches | |
$ git branch -a | |
# Delete a branch | |
$ git branch -d <branch_name> |
This file contains 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
git fetch --all | |
git reset --hard origin/master | |
git pull origin master |
This file contains 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
var val = 21.877768666 | |
Math.round(val * 1000000) / 1000000); | |
Output: | |
21.877769 |
This file contains 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
<script> | |
var sum = 0; | |
var numbers = [91, 2, 4, 45, 65, 32, 49]; | |
numbers.forEach(myFunction); | |
function myFunction(item) { | |
sum += item; | |
document.getElementById("demo").innerHTML = sum; | |
} | |
</script> |
This file contains 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
const array1 = ['a', 'b', 'c']; | |
array1.forEach(element => console.log(element)); | |
// expected output: "a" | |
// expected output: "b" | |
// expected output: "c" |
This file contains 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
// set data on localstorage | |
localStorage.setItem("username", "admin"); | |
// get data from localstorage | |
localStorage.getItem("username"); |
NewerOlder