How to get the current year in JavaScript
Steps : Create a new Date() object. call getFullYear() from the object. the code will as bellow - var date = new Date(); var currentYear = date.getFullYear() console.log(currentYear); O…
Steps : Create a new Date() object. call getFullYear() from the object. the code will as bellow - var date = new Date(); var currentYear = date.getFullYear() console.log(currentYear); O…
There are many way to loop JavaScript array, some of them are - for (var i = 0; i < xs.length; i++) { console.log(xs[i]); } xs.forEach((x, i) => console.log(x)); for (const x of xs) …
Using Circle jQuery Plugin: jquery cycle plugin http://malsup.com/jquery/cycle/ Example: <script type="text/javascript"> $(function() { $('#marquee'…
Method 1 : Use DateTime class as bellow $date = new DateTime(); $date->modify('-1 days')->format('Y-m-d'); Method 2: Use strtotime function in date function as bell…
Method 1 : Use DateTime class as bellow $date = new DateTime(); $date->modify('+1 days')->format('Y-m-d'); Method 2: Use strtotime function in date function as bello…