Tutorials 5
Installing Protractor For AngularJS Testing
Protractor provides end to end testing for AngularJS application. In this demo, “We will learn to install protractor”. To install protractor use npm install –g protractor command in the terminal as following screenshot: To set up protractor we need to update webdriver-manager using update command as following screenshot. Web driver manager can be start […]
JavaScript BatteryManager API Demo
Navigator object provides Battery API for accessing charging attribute. a BatteryManager object can be accessed using getBattery() method. In this demo, “We will learn to access charging attribute on chargingchange event fired by BatteryManager”. The following code shows the accessing of BatteryManager API. <!DOCTYPE html> <html> <head lang="en"> <title>Battery Demo</title> </head> <body> <script> navigator.getBattery().then(function(battery) […]
Lodash Pluck And Where Method Example
lodash provides many utility methods for JavaScript developer. pluck() method is used for get the values of keys from a collection/array. where() method returns an array of element with matching property values. In this demo, “We will learn to use the methods pluck and where in lodash utility library”. The following code shows the […]
Random Number Generator Using Lodash Utility
lodash provides _.random() method to generate number. It takes 3 parameter min,max and boolean flag.The boolean flag with true value indicates the output as floating point number. In this demo, “We will learn about random() method to generate a random number”. The following code shows the use of random() method. <!DOCTYPE html> <html> <head> […]