How to do it...

Now we can add a script tag in the body element and use lodash functions:

<script> var teams = ["Barcelona", "Real Madrid", "Manchester United", "Borissia Dortmund", "Chelsea", "Arsenal", "Bayern Munich", "Milan", "Juventus", "Galatasaray"]; console.log("First element in teams: ", _.first(teams)); console.log("Last element in teams: ", _.last(teams)); var books = [ { title: "Matrix", price: 40 }, { title: "Lord of the Rings", price: 30 }, { title: "Harry Potter", price: 30 }, { title: "White Fang", price: 5 }, { title: "Godfather", price: 25 } ]; console.log("Name of the cheapest book is ", _.chain(books).sortBy('price').first().value().title) console.log("Available chars:", _.times(26, function(x) { return String.fromCharCode(65+x); ...

Get ASP.NET Core MVC 2.0 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.