Skip to content

Instantly share code, notes, and snippets.

@vishalbasnet23
Created April 24, 2017 11:13
Show Gist options
  • Save vishalbasnet23/93cfa0a755547a27698d21cc8485d936 to your computer and use it in GitHub Desktop.
Save vishalbasnet23/93cfa0a755547a27698d21cc8485d936 to your computer and use it in GitHub Desktop.
Console.log tricks
/**
* 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]
/**
* Display array objects in table
*/
let myData = [{
name: "Bishal",
age: 24,
email: "vishalbasnet23@live.com"
}, {
name: "vishal",
age: 24,
email: "vishalbasnet23@gmail.com"
}];
console.log(myData);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment