recherche

Maison  >  Questions et réponses  >  le corps du texte

javascript - JS不换行输出到控制台的语句是什么?

ringa_leeringa_lee2858 Il y a quelques jours2609

répondre à tous(1)je répondrai

  • 高洛峰

    高洛峰2017-04-11 10:45:24

    http://codepen.io/momoko8443/...

    var str = "";
    for(var i=1;i<=9;i++){
      for(var j=1;j<=i;j++){
        str += i + "*" + j + "=" + i*j + " ";
        if(i === j){
          str += "\n";
        }
      }
    }
    console.log(str);

    répondre
    0
  • Annulerrépondre