publish(){
const currentDate = new Date();
console.log(currentDate);
const getMonth = currentDate.toLocaleString('en-US', {month: 'short'});
console.log(getMonth);
const getDay = currentDate.getDate();
let myPost = {
name: "Kim Hyun",
userImage: "https://picsum.photos/100?random=3",
postImage: this.uploadImg,
month: getMonth,
day: getDay,
liked: false,
content: this.writingText,
filter: this.setlectedFilter,
};
this.infoData.unshift(myPost);
this.writingText = "";
this.step = 0;
}
라는 함수가 있는데
const currentDate = new Date();
console.log(currentDate);
const getMonth = currentDate.toLocaleString('en-US', {month: 'short'});
console.log(getMonth);
const getDay = currentDate.getDate();
변수들을 따로 전역으로 옮기려면 어디에두어야하나요