Lodash.js – dropRight() function
A simple Lodash.js example of the dropRight() function, which drops a given amount of the elements starting from the end of the array.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<meta name="description" content="Tizen Angular.js example"/>
<title>Tizen lodash.js example</title>
<script src="js/lodash.min.js"></script>
</head>
<body>
<div id="first">
</div>
<br>
<div id="second">
</div>
<script>
var firstDiv = document.getElementById('first');
var secondDiv = document.getElementById('second');
var firstValue = [1,2,6,14,23,134];
var result = _.dropRight(firstValue,3);
firstDiv.innerHTML = "From the array " + firstValue + " we take using the drop function 3 elements, counting from the end of the array...";
secondDiv.innerHTML = "...and we get: " + result;
</script>
</body>
</html>