Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
JavaScript Assignment
Project
Project
Details
Activity
Releases
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
Nikitha Moosapet
JavaScript Assignment
Commits
c29c1f29
Commit
c29c1f29
authored
Apr 09, 2021
by
Nikitha Moosapet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Commiting the JavaScript Assignments
parent
357d2c0e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
286 additions
and
0 deletions
+286
-0
Assignment.html
Assignment.html
+260
-0
FunctionAssg.html
FunctionAssg.html
+26
-0
No files found.
Assignment.html
0 → 100644
View file @
c29c1f29
<html>
<head>
<title>
Arithematic Operators
</title>
</head>
<body>
<h1>
Introduction to Java Script Operators
</h1>
<script
type=
"text/javascript"
>
var
a
=
19
;
var
b
=
12
;
var
c
=
15
;
var
linebreak
=
"<br/>"
;
document
.
write
(
"a + b = "
);
result
=
a
+
b
;
document
.
write
(
result
);
document
.
write
(
linebreak
);
document
.
write
(
"a - b = "
);
result
=
a
-
b
;
document
.
write
(
result
);
document
.
write
(
linebreak
);
document
.
write
(
"a / b = "
);
result
=
a
/
b
;
document
.
write
(
result
);
document
.
write
(
linebreak
);
document
.
write
(
"a % b = "
);
result
=
a
%
b
;
document
.
write
(
result
);
document
.
write
(
linebreak
);
document
.
write
(
"a + b + c = "
);
result
=
a
+
b
+
c
;
document
.
write
(
result
);
document
.
write
(
linebreak
);
a
=
++
a
;
document
.
write
(
"++a = "
);
result
=
++
a
;
document
.
write
(
result
);
document
.
write
(
linebreak
);
b
=
--
b
;
document
.
write
(
"--b = "
);
result
=
--
b
;
document
.
write
(
result
);
document
.
write
(
linebreak
);
document
.
write
(
"(a == b) => "
);
result
=
(
a
==
b
);
document
.
write
(
result
);
document
.
write
(
linebreak
);
document
.
write
(
"(a < b) => "
);
result
=
(
a
<
b
);
document
.
write
(
result
);
document
.
write
(
linebreak
);
document
.
write
(
"(a > b) => "
);
result
=
(
a
>
b
);
document
.
write
(
result
);
document
.
write
(
linebreak
);
document
.
write
(
"(a != b) => "
);
result
=
(
a
!=
b
);
document
.
write
(
result
);
document
.
write
(
linebreak
);
document
.
write
(
"(a >= b) => "
);
result
=
(
a
>=
b
);
document
.
write
(
result
);
document
.
write
(
linebreak
);
document
.
write
(
"(a <= b) => "
);
result
=
(
a
<=
b
);
document
.
write
(
result
);
document
.
write
(
linebreak
);
document
.
write
(
"((a > b) ? 100 : 200) => "
);
result
=
(
a
>
b
)
?
100
:
200
;
document
.
write
(
result
);
document
.
write
(
linebreak
);
document
.
write
(
"((a < b) ? 100 : 200) => "
);
result
=
(
a
<
b
)
?
100
:
200
;
document
.
write
(
result
);
document
.
write
(
linebreak
);
</script>
</body>
</html>
<html>
<head>
<title>
If_ELSE
</title>
</head>
<body>
<h1>
Welcome to IF_ELSE Concept
</h1>
<script
type =
"text/javascript"
>
var
book
=
"Javascript"
;
if
(
book
==
"DBMS"
)
{
document
.
write
(
"<b>Database Management Systems Book</b>"
);
}
else
if
(
book
==
"Java"
)
{
document
.
write
(
"<b>Java Fundamentals Book</b>"
);
}
else
if
(
book
==
"Javascript"
)
{
document
.
write
(
"<b>Basic Concepts of Javascript</b>"
);
}
else
{
document
.
write
(
"<b>Unknown Book</b>"
);
}
</script>
</body>
<html>
<html>
<head>
<title>
Switch Statements
</title>
</head>
<body>
<h1>
Welcome to Switch Concept
</h1>
<script
type =
"text/javascript"
>
var
grade
=
'A'
;
document
.
write
(
"Entering switch block<br />"
);
switch
(
grade
)
{
case
'A'
:
document
.
write
(
"Good job<br />"
);
break
;
case
'B'
:
document
.
write
(
"Pretty good<br />"
);
break
;
case
'C'
:
document
.
write
(
"Passed<br />"
);
break
;
case
'D'
:
document
.
write
(
"Not so good<br />"
);
break
;
case
'F'
:
document
.
write
(
"Failed<br />"
);
break
;
default
:
document
.
write
(
"Unknown grade<br />"
)
}
document
.
write
(
"Exiting switch block"
);
</script>
</body>
</html>
<html>
<head>
<title>
Welcome to While Loops
</title>
</head>
<body>
<h1>
Welcome to While Loops
</h1>
<script
type =
"text/javascript"
>
var
count
=
0
;
document
.
write
(
"Starting Loop "
);
while
(
count
<
10
)
{
document
.
write
(
"Current Count : "
+
count
+
"<br />"
);
count
++
;
}
document
.
write
(
"Loop stopped!"
);
</script>
</body>
</html>
<html>
<head>
<title>
Welcome to Do - While Loops
</title>
</head>
<body>
<h1>
Welcome to D- While While Loops
</h1>
<script
type =
"text/javascript"
>
var
count
=
1
;
document
.
write
(
"Starting Loop"
+
"<br />"
);
do
{
document
.
write
(
"Current Count : "
+
count
+
"<br />"
);
count
++
;
}
while
(
count
<
5
);
document
.
write
(
"Loop stopped!"
);
</script>
</body>
</html>
<html>
<head>
<title>
Welcome to For Loop
</title>
</head>
<body>
<h1>
Welcome to For Loops
</h1>
<script
type =
"text/javascript"
>
var
count
;
document
.
write
(
"Starting Loop"
+
"<br />"
);
for
(
count
=
0
;
count
<
10
;
count
++
)
{
document
.
write
(
"Current Count : "
+
count
);
document
.
write
(
"<br />"
);
}
document
.
write
(
"Loop stopped!"
);
</script>
</body>
</html>
<html>
<head>
<title>
Welcome to For-In Loops
</title>
</head>
<body>
<h1>
Welcome to For-In Loops
</h1>
<script
type =
"text/javascript"
>
const
arr
=
[
'Welcome'
,
'to'
,
'JavaScript'
];
// using for...in loop
for
(
let
x
in
arr
)
{
console
.
log
(
arr
[
x
]);
document
.
write
(
arr
[
x
]);
}
</script>
</body>
</html>
<html>
<head>
<title>
Welcome to Loop Control
</title>
</head>
<body>
<h1>
Welcome to Loop Control
</h1>
<script
type =
"text/javascript"
>
var
x
=
0
;
document
.
write
(
"Entering the loop<br /> "
);
while
(
x
<
8
)
{
if
(
x
==
4
)
{
break
;
// breaks out of loop completely
}
x
++
;
document
.
write
(
x
+
"<br />"
);
}
document
.
write
(
"Exiting the loop!<br /> "
);
</script>
</body>
</html>
FunctionAssg.html
0 → 100644
View file @
c29c1f29
<html>
<head>
<title>
Functions
</title>
</head>
<h1>
Welcome to Functions
</h1>
<script
type =
"text/javascript"
>
function
myName
(
first
,
last
)
{
var
name
;
name
=
first
+
last
;
return
name
;
}
function
myFullName
()
{
var
fullName
;
fullName
=
myName
(
'Nikitha'
,
'Moosapet'
);
document
.
write
(
fullName
);
}
</script>
</head>
<body>
<p>
Click the following button to call the function
</p>
<form>
<input
type =
"button"
onclick =
"myFullName()"
value =
"Click"
>
</form>
</body>
</html>
\ 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