Created
April 24, 2017 11:13
-
-
Save vishalbasnet23/93cfa0a755547a27698d21cc8485d936 to your computer and use it in GitHub Desktop.
Console.log tricks
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
/** | |
* Test Library on console | |
*/ | |
let cdn = "https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.4/lodash.min.js"; | |
let script = document.createElement('script'); | |
script .src = cdn; | |
document.getElementsByTagName('head')[0].appendChild(script); | |
// Now Test the library methods | |
// yes we have lodash loaded in the console | |
var array = [1, 2, 3]; | |
_.reverse(array); // Ouput: [3, 2, 1] |
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
/** | |
* Display array objects in table | |
*/ | |
let myData = [{ | |
name: "Bishal", | |
age: 24, | |
email: "[email protected]" | |
}, { | |
name: "vishal", | |
age: 24, | |
email: "[email protected]" | |
}]; | |
console.log(myData); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment