.substring error: “is not a function”

后端 未结 4 1408
执笔经年
执笔经年 2020-12-30 19:34

I don\'t understand why I get an error message using the substring method to declare a variable.

I want to use the first part of the URL in a comparison.

Sit

4条回答
  •  一生所求
    2020-12-30 19:48

    You can use substr

    for example:

    new Date().getFullYear().toString().substr(-2)
    

提交回复
热议问题