📌  相关文章
📜  如何在javascript代码示例中获取函数外部的变量值

📅  最后修改于: 2022-03-11 15:02:01.305000             🧑  作者: Mango

代码示例1
/* Not putting "var", "let" or "const" will make the variable Public
And usable outside a functin */

function Play(){
      Video = 12 // Seconds
    var Length = 15
}
console.log(Video) // Prints 12
console.log(Length) // "Lenght" is undefined