What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-01-22 17:41:29
es6 reverse foreach
var arr = [1, 2, 3, 4, 5]; arr.slice().reverse() .forEach(function(item) { console.log(item);  ... Add solution -
Other 2022-01-22 05:31:04
avoid div slider stack on each other when position absolute
//avoid slides in slider stack on each other when position:absolute in responsive mode //use 'vw'(automatically responsive) instead of 'px'(will stretch the elements when page responsive) //each card width: cards.forEach((card, index) => card.style.lef... Add solution -
Javascript 2022-01-22 02:10:28
js new array of length
ES6 gives us Array.from so now you can also use Array.from(Array(5)).forEach(alert) If you want to initialize with a certain value, these are good to knows... Array.from('abcde'), Array.from('x'.repeat(5)) or Array.from({length: 5}, (v, i) => i) /... Add solution -
Javascript 2021-11-22 03:27:21
event from changed style
var observer = new MutationObserver(function(mutations) { mutations.forEach(function(mutationRecord) { console.log('style changed!'); }); }); var target = document.getElementById('myId'); observer.observe(target, { attributes : true, attri... Add solution