我正在尝试在团队云端硬盘上运行旧项目,但我不确定将使用哪个节点版本。有没有办法让我在代码中或使用终端检查它?
另外一个问题:
在 READ ME 文件中,它说它使用 Angular CLI 版本 6.0.3。-- 那我需要使用这个版本吗?
由于这是一个旧的 Angular 项目,我是否需要更新依赖项的版本?如果是,怎么办?我需要使用什么命令?
node_modules
如果package-lock.json
我使用npm install可以删除吗?
这是我的整个 package.json
{
"name": "sample-tool",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@agm/core": "^1.0.0-beta.7",
"@angular/animations": "^8.2.0-next.1",
"@angular/common": "^8.2.0-next.1",
"@angular/compiler": "^8.2.0-next.1",
"@angular/core": "^8.1.1",
"@angular/fire": "^5.4.2",
"@angular/forms": "^8.2.0-next.1",
"@angular/platform-browser": "^8.2.0-next.1",
"@angular/platform-browser-dynamic": "^8.2.0-next.1",
"@angular/router": "^8.2.0-next.1",
"@ng-bootstrap/ng-bootstrap": "^4.2.1",
"@swimlane/ngx-charts": "^10.1.0",
"@swimlane/ngx-datatable": "^15.0.2",
"angular-calendar": "^0.25.2", …
Run Code Online (Sandbox Code Playgroud) 我有一个示例数组:
let sampleArray = ["spider", "regards", "sorry"];
Run Code Online (Sandbox Code Playgroud)
如果我使用if 语句并删除其上的一些元素,我如何使用新值声明新的示例数组。
这是我的代码:
let sampleArray = ["banana", "apple", "orange", "grapes"];
//let say the value of "fruits = apple"
if(sampleArray.includes(fruits)){ // will return TRUE, since 'apple' is included in the sampleArray
//Now, I will remove it on the array
sampleArray = sampleArray.filter(e => e !== fruits);
console.log("sampleArray: ", sampleArray) // return ["banana", "orange", "grapes"]
Run Code Online (Sandbox Code Playgroud)
现在,我怎样才能再次将它应用到SAME if 语句中,if(sampleArray.includes(fruits))
以便如果我再次调用它,值是现在 ["banana", "orange", "grapes"]
,我的新水果是葡萄来拥有新的数组["banana", "orange"]
这可能吗?我只能使用该语句(sampleArray.includes(fruits))
一次。