Skip to content

Instantly share code, notes, and snippets.

@piecioshka piecioshka/snippet.js
Last active Mar 11, 2019

Embed
What would you like to do?
Shim for jQuery.not() #jQuery
const element = $('.file-box:nth-child(2)')
const list = $$('.file-box')
function not($list, element) {
const list = Array.from($list);
const index = list.indexOf(element);
return list.slice(index);
}
Array.from(not(list, element))
.forEach(e => e.style.background = 'red')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.