From c9f0b5f55cdf4aaa808543da51fa3e686abaec14 Mon Sep 17 00:00:00 2001 From: a290914469 Date: Fri, 21 Jun 2024 17:18:00 +0800 Subject: [PATCH] Fri Jun 21 17:18:00 CST 2024 inscode --- .inscode | 6 +++++- index.js | 19 ++++++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/.inscode b/.inscode index ecc8bdd..e177731 100644 --- a/.inscode +++ b/.inscode @@ -1,6 +1,10 @@ run = "npm i && npm run dev" +language = "node" [env] PATH = "/root/${PROJECT_DIR}/.config/npm/node_global/bin:/root/${PROJECT_DIR}/node_modules/.bin:${PATH}" XDG_CONFIG_HOME = "/root/.config" -npm_config_prefix = "/root/${PROJECT_DIR}/.config/npm/node_global" \ No newline at end of file +npm_config_prefix = "/root/${PROJECT_DIR}/.config/npm/node_global" + +[debugger] +program = "main.js" diff --git a/index.js b/index.js index 2d7e683..92e2092 100644 --- a/index.js +++ b/index.js @@ -1 +1,18 @@ -console.log("欢迎来到 InsCode"); \ No newline at end of file +const state = { + a: 1, + setA (count) { + state.a = count + } +}; + +function run () { + const { a, setA } = state + console.log(state.a) + setA(a + 1) + console.log(state.a) +} + +run() +run() +run() +run() \ No newline at end of file -- GitLab