Tips/Tricks: Javascript or JQuery

1) How to get difference between 2 days in days using Javascript


var noOfDays = (finishDate - startDate) / (1000 * 60 * 60 * 24);

2) Remove Last Comma from a string

var str = commaInLastStr.replace(/,\s*$/, "")

Happy Kooding… Hope this helps!

Advertisements