Home  >  Q&A  >  body text

What is the difference between document.write() before and after executing code a++?

<script type="text/javascript">

var a=1

for (var i=1;i<99;i )

{

a

document.write(a "<br>")

}</script>

与下列代码的区别

<script type="text/javascript">

var a=1

for (var i=1;i<99;i )

{

document.write(a "<br>")

a

}</script>

BlackBlack1634 days ago1453

reply all(1)I'll reply

  • DY。

    DY。2020-05-08 01:46:11

    The former prints out starting from 2

    The latter prints out starting from 1

    a is equivalent to a =a 1

    reply
    0
  • Cancelreply