Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

get previous year in javascript

const currentYear = new Date().getFullYear(); // 2020

const previousYear =  currentYear-1;

console.log(previousYear); // 2019
Comment

PREVIOUS NEXT
Code Example
Javascript :: js create array with default value 
Javascript :: checkbox default value and checked value get in jquery 
Javascript :: how to submit form on changed url in function in jquery 
Javascript :: js sort number array 
Javascript :: how to get range slider value in javascript 
Javascript :: date format using javascript 
Javascript :: mongodb find all that dont have property 
Javascript :: How to do a timer angular 
Javascript :: add toaster in angular 
Javascript :: node js event emitter 
Javascript :: js date in two weeks 
Javascript :: cart page url in shopify 
Javascript :: json stringify double quotes 
Javascript :: javascript get all days of week 
Javascript :: node js response header 
Javascript :: how to remove property from object javascript 
Javascript :: check object is null empty or undefined 
Javascript :: react navigation history clear 
Javascript :: javascript array delete first element 
Javascript :: mongodb mongoose aggregate two collections using lookup & format the result set. 
Javascript :: remove duplicates multidimensional array javascript 
Javascript :: new Date() get speicifc hours min sec 
Javascript :: javascript get string from array with space between 
Javascript :: js if else 
Javascript :: How to send form data from react to express 
Javascript :: javascript insert text in textarea at cursor position 
Javascript :: javascript remove some words list from string 
Javascript :: handlechange in react 
Javascript :: insert element in specific index javascript 
Javascript :: mongoose return only a certain number of results 
ADD CONTENT
Topic
Content
Source link
Name
6+8 =