-
Notifications
You must be signed in to change notification settings - Fork 349
Dzień 1 #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Dzień 1 #3
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,17 @@ | ||
console.log('Wygląda na to, że wszystko działa :)'); | ||
console.log('Wygląda na to, że wszystko działa :)'); | ||
|
||
// const text = "Hello, World!"; | ||
// let counter = 0; | ||
// | ||
// const intervalId = setInterval(()=>{ | ||
// console.log(text[counter]); | ||
// ++counter; | ||
// if(counter == text.length){ | ||
// clearInterval(intervalId) | ||
// } | ||
// },100); | ||
|
||
process.argv.forEach((val, index) => { | ||
console.log(`${index}: ${val}`); | ||
}); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
//Twój kod | ||
//Twój kod | ||
console.log("Kuba Matwiejew"); | ||
const timeoutId = setTimeout(()=>{ | ||
console.log("wita się z Node.js!") | ||
},5000); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,38 @@ | ||
//Twój kod | ||
//Twój kod | ||
// const timeout1 = setTimeout(()=>{ | ||
// console.log("Node.js") | ||
// },4000); | ||
// const timeout2 = setTimeout(()=>{ | ||
// console.log("się") | ||
// },1000); | ||
// const timeout3 = setTimeout(()=>{ | ||
// console.log("Witam") | ||
// },0); | ||
// const timeout4 = setTimeout(()=>{ | ||
// console.log("i korzystam") | ||
// },6000); | ||
// const timeout5 = setTimeout(()=>{ | ||
// console.log("w konsoli") | ||
// },5000); | ||
// const timeout6 = setTimeout(()=>{ | ||
// console.log("z funkcji czasu!") | ||
// },7000); | ||
// const timeout7 = setTimeout(()=>{ | ||
// console.log("z") | ||
// },2000); | ||
// const timeout8 = setTimeout(()=>{ | ||
// console.log("programem") | ||
// },3000); | ||
const text = [`Node.js`, `się`, `Witam`, `i korzystam`, `w konsoli`, `z funkcji czasu!`, `z`, `programem`]; | ||
const timer = [4000, 1000, 0, 6000, 5000, 7000, 2000, 3000]; | ||
if(text.length == timer.length){ | ||
for(let i=0; i<text.length; i++){ | ||
setTimeout(()=>{ | ||
console.log(text[i]) | ||
},timer[i]) | ||
} | ||
} else { | ||
console.log(`Tablice nie są równe`) | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
//Twój kod | ||
//Twój kod | ||
let result = 0; | ||
for (let i = 2; i < process.argv.length; i++) { | ||
result += Number(process.argv[i]); | ||
} | ||
console.log(result); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,7 @@ | ||
//Twój kod | ||
//Twój kod | ||
for (let i = 2; i < process.argv.length; i++) { | ||
let number = parseInt(process.argv[i]); | ||
let timeoutId = setTimeout(()=>{ | ||
console.log(number) | ||
},number*1000); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Podpowiedź: czytelniejszy były .forEach lub for..in