Javascript Closure建議寫法 Posted on 2020-08-21 Edited on 2024-07-03 In JavaScript Views: Disqus: Symbols count in article: 352 Reading time ≈ 1 mins.Javascript Closure建議寫法這篇介紹jshint、eslint建議Javascript Closure的寫法。Javascript Closure Example123456789101112131415161718192021const Test1 = (function () { let a = 5; function function1() { a += 1; return a; } function function2() { a -= 1; return a; } return { function1, function2, };}());console.log(Test1.function1());console.log(Test1.function2());