100 Most Asked JavaScript Interview
100 Most Asked JavaScript Interview
100 Most Asked JavaScript Interview
33. What are arrow functions? How are they different from regular
functions?
Arrow functions are a concise syntax for defining functions in JavaScript. They have a
shorter syntax compared to regular functions and do not bind their own this value.
78. What is the purpose of the getDate() method in JavaScript Date objects?
The getDate() method is used to retrieve the day of the month value of a JavaScript Date
object. It returns the day as a number between 1 and 31.
79. What is the purpose of the getDay() method in JavaScript Date objects?
The getDay() method is used to retrieve the day of the week value of a JavaScript Date
object. It returns a zero-based index, where Sunday is represented by 0 and Saturday by 6.
80. What is the purpose of the getHours() method in JavaScript Date
objects?
The getHours() method is used to retrieve the hour value of a JavaScript Date object. It
returns the hour as a number between 0 and 23.
86. What is the purpose of the setDate() method in JavaScript Date objects?
The setDate() method is used to set the day of the month value of a JavaScript Date object. It
allows modifying the day component of a date.
93. What is the purpose of the setTime() method in JavaScript Date objects?
The setTime() method is used to set the timestamp value of a JavaScript Date object. It
allows modifying the date and time by providing a new timestamp.