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
let controller = { | |
axios: {}, | |
newArtist: function (artist) { | |
this.axios.post('/create', { | |
newArtist: artist | |
}) | |
.then((responce) => { | |
console.log(responce.data); | |
}) | |
.catch((error) => { |
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 nestedObject = { | |
speakers: [{name:"Elie"},{name:"Tim"},{name:"Matt"}], | |
data: { | |
continents: { | |
europe: { | |
countries: { | |
switzerland: { | |
capital: "Bern", | |
population: 8000000 | |
} |
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 app = { | |
db: {}, | |
next_id: 0, | |
create: function(newThing) { | |
if(newThing !== ''){ | |
this.db[this.next_id] = newThing; | |
this.next_id ++; | |
return 'NEW OBJECT WAS CREATED' ; | |
}else{ |
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 calc = { | |
lastResult: null, | |
add: function (arg1, arg2) { | |
return arg1 + arg2; | |
}, | |
substract: function (arg1, arg2) { |
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 tripledouble(num1, num2) { | |
var check1 = ''; | |
var check2 = ''; | |
if (typeof num1 !== 'number' || typeof num2 !== 'number'){ | |
return 0; | |
} | |
var a = num1.toString().split(''); | |
var b = num2.toString().split(''); | |
for (var i = 0; i < a.length; i++){ |