Last active
August 29, 2015 13:57
-
-
Save davestewart/9771415 to your computer and use it in GitHub Desktop.
Console.log shortcut. Mainly useful for sticking in a jQuery .each() loop...
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
| // function | |
| function log(){ console.log.apply(console, Array.prototype.slice.call(arguments, 0)); } | |
| // as a shortcut | |
| log(1,2,3); | |
| // 1 2 3 | |
| // as a proxy | |
| $('section').each(log); | |
| /* | |
| 0 <section id="home" class="tab-pane">…</section> | |
| 1 <section id="library" class="tab-pane">…</section> | |
| 2 <section id="workspace" class="tab-pane active">…</section> | |
| 3 <section id="editor" style>…</section> | |
| 4 <section id="input-output" class="element">…</section> | |
| */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment