string concat vs using toisostring

Edit on GitHub

Setup

Tests

  • string concat

    date = new Date();
    string = date.getDate() + "-" + date.getMonth() + "-" + date.getFullYear()a
  • using toisostring

    date = new Date();
    string = date.toISOString().split("T")[0]