Tag: JavaScript

Web Storage concepts and usage

What is Web Storage Web storage is known as DOM(Document Object Model) storage. It provides web application software method and protocols used for storing data in a web browser similar to cookies. But it has greatly enhanced capacity…

Read More »

Tips to Add Tooltip to Select2

How to add tooltip in select2 When selected text is long in select2, then it does not show the full text. So, it is very difficult to understand what is selected. For the above problem we can solve…

Read More »

Using Sinon to stub Mongoose calls and return Promise

Suppose we have a schema var User = require(‘./schemas/UserSchema’).User; and we want to write unit test for like bellow code: var getUserById = function () { return User.findOne({_id: ‘001’}).exec(); }; Before writing unit test we can mock the…

Read More »