git checkout [commit ID] -- path/to/file
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
var a = { a: 1, b: 2, c:3 }; | |
var b = { d: 4, e:5 }; | |
function d1(obj) { | |
obj.a = 5; | |
} | |
d1(a) | |
// a = { a: 5, b: 2, c: 3 } |
// From https://stackoverflow.com/a/39909754
/**
* Overwrite Date constructor with configurable current time
* @param {object} Date - The native Date object
* @param {Number} year - Optional. Default year to this.
* @param {Number} month - Optional. Default month to this.
* @param {Number} hour - Optional. Default hour to this.
* @param {Number} day - Optional. Default day to this.
* @param {Number} minute - Optional. Default minute to this.
Vue.js provides a good example for working with deep nested objects or tree data structures. But, how about when Vuex is involved?
Fortunately, Evan You (Vue.js' creator) gives us a hint:
...Or, you can use the same flat structure and use ids to reference nested items, and use a Vuex getter in each tree item component to retrieve its children.
So, how do we go about doing that? After a few attempts getting nested objects' reactivity to work, here is what I did.
Foundation Tabs: Each <a>
link in <li>
SHOULD & MUST have a href
that match the ID of a tab.
Failure to do so will result in JS error.
E.g. The code below is invalid:
<ul class="tabs" data-tabs id="example-tabs">
Web browsers now support jQuery-like query selectors using document.querySelector()
.
For the jQuery code $('.sample#test')
, the conventional vanilla JS way to do it might be:
var divById = document.getElementById('#test');
// or