Last active
November 21, 2017 22:43
-
-
Save suissa/cc1b8c380348b1c30f1f69d28887e81a to your computer and use it in GitHub Desktop.
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
const $$ = ( selector, context = document ) => { | |
const elements = context.querySelectorAll( selector ) | |
( selector[ 0 ] === '#' ) // OU COM REGEX? | |
? elements[ 0 ] | |
: elements | |
} | |
$$( '#myjQuery' ).innerHTML = $$( 'div' ).length | |
$( '#jQuery' ).innerHTML = $( 'div' ).length |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment