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 objOne = {name: 'avery', height: 6}; | |
let objTwo = {...objOne, height: 4}; | |
console.log(objOne, objTwo); | |
// {name: "avery", height: 6} {name: "avery", height: 4} | |
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 objOne = {name: 'buck', height: 6}; | |
objOne.name = 'avery'; // object mutated | |
// non-mutation with assign method | |
// don't forget the empty object as the first parameter | |
let objTwo = Object.assign({}, objOne, {height: 4}); | |
console.log(objOne, objTwo); | |
// {name: "avery", height: 6} {name: "avery", height: 4} |
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 arrOne = [1, 2, 3]; | |
let arrTwo = [...arrOne, 4]; | |
console.log(arrOne, arrTwo); | |
// [1, 2, 3] [1, 2, 3, 4] | |
let arrThree = [-1, 0, ...arrTwo]; | |
console.log(arrThree); | |
// [-1, 0, 1, 2, 3, 4] |
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 myArr = [1, 2, 3]; | |
console.log(...myArr); | |
// 1 2 3 | |
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 myArr = [1, 2, 3]; | |
console.log(myArr); | |
// [1, 2, 3] | |
myArr.push(4); | |
console.log(myArr); | |
// [1, 2, 3, 4] | |
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 tween(finalPos, prevPos, tweenRatio) { | |
if (finalPos === prevPos) { | |
return prevPos; | |
} else { | |
let dist = Math.abs(finalPos - prevPos); | |
if (dist < 0.005) { | |
// set to final position when getting close | |
return prevPos; | |
} 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
console.log('test'); |
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
SpreeStore.module('Products.Show',function(Show, SpreeStore, Backbone,Marionette,$,_){ | |
Show.Product = Backbone.Marionette.ItemView.extend({ | |
tagName: 'div', | |
className: 'product', | |
template: "#product-template", | |
events: { | |
"click button": "addToCart", | |
"click #product-quantity-list li.quantity-drop": "selectQuantity", | |
"click #frequency-quantity-list li.quantity-drop": "selectFrequency", |
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
MADPRESS.About = { | |
init: function(data, callback) { | |
}, | |
index: function(data, callback) { | |
var scrolling = false; | |
$('#about-side-nav').localScroll({ duration: 1000, onAfter: function() { |
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
MADPRESS.About = { | |
init: function(data, callback) { | |
}, | |
index: function(data, callback) { | |
var scrolling = false; | |
$('#about-side-nav').localScroll({ duration: 1000, onAfter: function() { |