Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to create list of years js

function generateArrayOfYears() {
  var max = new Date().getFullYear()
  var min = max - 9
  var years = []

  for (var i = max; i >= min; i--) {
    years.push(i)
  }
  return years
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript string contains multiple substrings 
Javascript :: how to send a message to a discord server using a bot 
Javascript :: event listener javascript 
Javascript :: react native new line character 
Javascript :: how to delete element at a particular index of array in react js 
Javascript :: destructure dynamic properties 
Javascript :: javascript get element by custom attribute 
Javascript :: There might be a problem with the project dependency tree. It is likely not a bug in Create React App, but something you need to fix locally. 
Javascript :: check if string matches regex js 
Javascript :: how to install mongodb in node js 
Javascript :: unexpected token react native stack navigation 
Javascript :: replace double slash with single slash node.js 
Javascript :: Read text file in vanilla JS 
Javascript :: fetch data flutter json 
Javascript :: .env file node js 
Javascript :: js classlist 
Javascript :: zoom in canvas javascript 
Javascript :: cypress click link contains text 
Javascript :: jquery read query string 
Javascript :: jquery set html of element 
Javascript :: if checkbox is checked open modal popup 
Javascript :: if input value is null do something 
Javascript :: file upload with angular material 
Javascript :: how to remove an element from a parent element javascript 
Javascript :: how to get the max value of two variables in math 
Javascript :: javascript get first property of object 
Javascript :: hide browser address bar javascript 
Javascript :: linear gradient reactjs 
Javascript :: flip a coin javascript 
Javascript :: month list javascript 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =