FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Javascript_implementation/functions.js at main · TheCodeCipher/Javascript_implementation · GitHub
TheCodeCipher
/
Javascript_implementation
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Javascript_implementation
/
functions.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
21 lines (21 loc) · 721 Bytes
Breadcrumbs
Javascript_implementation
/
functions.js
Copy path
File metadata and controls
21 lines (21 loc) · 721 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
function
calculateSquare
(
)
{
let
num1
=
document
.
getElementById
(
"num1"
)
.
value
;
let
square
=
num1
*
num1
;
document
.
getElementById
(
"output6"
)
.
innerHTML
=
`Square of
${
num1
}
is
${
square
}
`
;
}
const
add
=
(
a
,
b
)
=>
a
+
b
;
function
addNumbers
(
)
{
let
num_1
=
parseInt
(
prompt
(
"Enter first number:"
)
)
;
let
num_2
=
parseInt
(
prompt
(
"Enter second number:"
)
)
;
let
sum
=
add
(
num_1
,
num_2
)
;
document
.
getElementById
(
"output6"
)
.
innerHTML
=
`Sum of
${
num_1
}
and
${
num_2
}
is
${
sum
}
`
;
}
function
checkEvenOdd1
(
)
{
let
num1
=
document
.
getElementById
(
"num1"
)
.
value
;
let
result
=
num1
%
2
===
0
?
"Even"
:
"Odd"
;
document
.
getElementById
(
"output6"
)
.
innerHTML
=
`
${
num1
}
is
${
result
}
`
;
}
Back
|
FazBrowse Home
|
New Git URL