Created
January 24, 2017 09:29
-
-
Save Kruithne/a889c8ff047c3eb9b5a087bbf95deb4b to your computer and use it in GitHub Desktop.
Mini jQuery object constructor
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
renderObject = (target) => { | |
var elem = $(target.tag || "<div/>"); | |
for (var prop in target) { | |
if (!target.hasOwnProperty(prop)) | |
continue; | |
if (prop == "tag") | |
continue; | |
elem[prop](target[prop]); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment