Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
Some project
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yerlan Bakuyev
Some project
Commits
30c9a311
Commit
30c9a311
authored
Apr 05, 2023
by
Yerlan Bakuyev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#3
test commit
parent
37d94f1d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
0 deletions
+48
-0
main.js
js/main.js
+48
-0
No files found.
js/main.js
View file @
30c9a311
const
test
=
{
from
:
0
,
to
:
10
,
[
Symbol
.
iterator
]:
()
=>
{
return
{
current
:
test
.
from
,
last
:
test
.
to
,
next
()
{
if
(
this
.
current
<=
this
.
last
)
{
return
{
done
:
false
,
value
:
this
.
current
++
};
}
else
{
return
{
done
:
true
};
}
}
}
}
}
for
(
const
t
of
test
){
console
.
log
(
t
);
}
const
arr
=
[
0
,
1
,
20
,
34
];
const
it
=
arr
[
Symbol
.
iterator
]();
console
.
log
(
it
.
next
());
console
.
log
(
it
.
next
());
console
.
log
(
it
.
next
());
function
*
tracker
(){
const
start
=
Date
.
now
();
while
(
true
){
const
y
=
yield
Date
.
now
()
-
start
;
console
.
log
({
y
});
yield
y
;
}
}
const
tr1
=
tracker
();
const
tr2
=
tracker
();
console
.
log
(
tr1
.
next
(
1
).
value
);
console
.
log
(
tr2
.
next
().
value
);
console
.
log
(
tr1
.
next
(
33
).
value
);
setTimeout
(()
=>
{
console
.
log
(
tr1
.
next
(
3
).
value
);
console
.
log
(
tr2
.
next
(
6
).
value
);
console
.
log
(
tr1
.
next
(
3
).
value
);
},
2000
)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment