function add(num) {var counter = 0;return function (num) {counter += numreturn counter}}const addValue1 = add();console.log(addValue1(2))console.log(addValue1(4))console.log(addValue1(1))console.log(addValue1(9))console.log(addValue1(1))const addValue2 = add();console.log(addValue2(10))console.log(addValue2(20))
Create your own snippets You can easily define your own snippets { "hello" : { "scope" : "javascript,html" , "prefix" : "hello" , "body" : "$BLOCK_COMMENT_START Hello World $BLOCK_COMMENT_END" } }
Comments
Post a Comment