Detect mouse right-click with JavaScript

Detect Mouse right-click with JavaScript

In this tutorial, we will see how we can detect mouse right-clicks with Javascript. Click events have a button property associated with it, that allows us to get the exact mouse button. Mousedown and mouseup handlers may need an event to differentiate the clicks because these events trigger on any button. APIs in Javascript allow … Read more

How to Generate a Random Letter Using JavaScript

How to Generate a Random Letter Using JavaScript?

In this article, we will learn about how to generate a random letter from the alphabets using vanilla and simple JavaScript. Here, the code will consist of two things, q string that contains each letter of the alphabet you can randomly select from and an expression that randomly selects one of the characters from the … Read more

Removing array items from END until given condition is false using Lodash

Removing Array Items Using Lodash's _.dropWhile() from end

In today’s article, we will learn about how to remove array elements from the last until a specified condition is not satisfied in an array. To do so we can use _.dropRightWhile() function of lodash in JavaScript. About Lodash’s .dropRightWhile() Method Similar to the Lodash’s dropWhile() function, this function is also used to return the … Read more