Javascriptで質問です。

JavaScript17閲覧xmlns="http://www.w3.org/2000/svg">100

その他の回答(1件)

0

<!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <title></title> </head> <body> <script> const str = ['2020/12/07', '2021/03/09', '2021/09/07']; const date = []; for (var i = 0; i < str.length; i++) { date[i] = new Date(str[i]); console.log(date[i].toLocaleDateString()); } </script> </body> </html>