search

Home  >  Q&A  >  body text

javascript - The method in methods will get the value twice, the first time is empty

I originally wanted to get the length of the reply, but the error message was always undefined, and the page was displayed normally, so I logged the value and looked at it and found that it was executed twice and the first time the value was empty. I don’t know what it was. Why, can anyone help me look at it?

巴扎黑巴扎黑2736 days ago567

reply all(3)I'll reply

  • ringa_lee

    ringa_lee2017-05-18 11:05:08

    It must have been called twice, check carefully

    reply
    0
  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-05-18 11:05:08

    Then you have to check if you have called this method twice

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-05-18 11:05:08

    Isn’t it normal to call it twice?

    This will happen if you assign values ​​asynchronously

    reply
    0
  • Cancelreply