FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
java8-tutorial/res/nashorn7.js at master · kenjava/java8-tutorial · GitHub
kenjava
/
java8-tutorial
Public
forked from
winterbe/java8-tutorial
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
java8-tutorial
/
res
/
nashorn7.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
27 lines (21 loc) · 555 Bytes
Breadcrumbs
java8-tutorial
/
res
/
nashorn7.js
Copy path
File metadata and controls
27 lines (21 loc) · 555 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
function
sqrt
(
x
)
x
*
x
print
(
sqrt
(
3
)
)
;
var
array
=
[
1
,
2
,
3
,
4
]
;
for
each
(
var
num
in
array
)
print
(
num
)
;
var
runnable
=
new
java
.
lang
.
Runnable
(
)
{
run
:
function
(
)
{
print
(
'on the run'
)
;
}
}
;
runnable
.
run
(
)
;
var
System
=
Java
.
type
(
'java.lang.System'
)
;
System
.
out
[
"println(double)"
]
(
12
)
;
var
Arrays
=
Java
.
type
(
"java.util.Arrays"
)
;
var
javaArray
=
Java
.
to
(
[
2
,
3
,
7
,
11
,
14
]
,
"int[]"
)
;
Arrays
.
stream
(
javaArray
)
.
filter
(
function
(
num
)
{
return
num
%
2
===
1
;
}
)
.
forEach
(
function
(
num
)
{
print
(
num
)
;
}
)
;
Back
|
FazBrowse Home
|
New Git URL