Skip to content

Commit 429604f

Browse files
author
Redwan Sharafat Kabir
committed
Master of JavaScript coding
1 parent 00c982b commit 429604f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1167
-0
lines changed

Basic JS and HTML.sln

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.28010.2026
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "Basic JS and HTML", "Basic JS and HTML\", "{8214E60A-A28C-439F-B94B-1EAA5ED23C8C}"
7+
ProjectSection(WebsiteProperties) = preProject
8+
TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.6.1"
9+
Debug.AspNetCompiler.VirtualPath = "/localhost_63779"
10+
Debug.AspNetCompiler.PhysicalPath = "Basic JS and HTML\"
11+
Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_63779\"
12+
Debug.AspNetCompiler.Updateable = "true"
13+
Debug.AspNetCompiler.ForceOverwrite = "true"
14+
Debug.AspNetCompiler.FixedNames = "false"
15+
Debug.AspNetCompiler.Debug = "True"
16+
Release.AspNetCompiler.VirtualPath = "/localhost_63779"
17+
Release.AspNetCompiler.PhysicalPath = "Basic JS and HTML\"
18+
Release.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_63779\"
19+
Release.AspNetCompiler.Updateable = "true"
20+
Release.AspNetCompiler.ForceOverwrite = "true"
21+
Release.AspNetCompiler.FixedNames = "false"
22+
Release.AspNetCompiler.Debug = "False"
23+
VWDPort = "63779"
24+
SlnRelativePath = "Basic JS and HTML\"
25+
DefaultWebSiteLanguage = "Visual C#"
26+
EndProjectSection
27+
EndProject
28+
Global
29+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
30+
Debug|Any CPU = Debug|Any CPU
31+
EndGlobalSection
32+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
33+
{8214E60A-A28C-439F-B94B-1EAA5ED23C8C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
34+
{8214E60A-A28C-439F-B94B-1EAA5ED23C8C}.Debug|Any CPU.Build.0 = Debug|Any CPU
35+
EndGlobalSection
36+
GlobalSection(SolutionProperties) = preSolution
37+
HideSolutionNode = FALSE
38+
EndGlobalSection
39+
GlobalSection(ExtensibilityGlobals) = postSolution
40+
SolutionGuid = {6F21B56E-C10C-4352-B212-08CF166DB0AE}
41+
EndGlobalSection
42+
EndGlobal

Basic JS and HTML/Array addition.html

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<script>
5+
var sum = 0, i, n = prompt("Array size: "), ar = [];
6+
for (i = 0; i < n; i++) {
7+
ar[i] = prompt("Elements: ");
8+
}
9+
10+
ar = ar.map(Number);
11+
12+
for (i = 0; i < ar.length; i++) {
13+
sum = (sum + ar[i]);
14+
}
15+
16+
document.write("Result: " + sum);
17+
</script>
18+
<style>
19+
body {
20+
background: #ddd none repeat scroll 0 0;
21+
color: #d02a13;
22+
font-family: 'Calibri MT Extra';
23+
font-size: 30px;
24+
text-align: left;
25+
}
26+
</style>
27+
</head>
28+
<body>
29+
</body>
30+
</html>

Basic JS and HTML/Array.html

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8" />
5+
<title></title>
6+
<style>
7+
body {
8+
background: #ddd none repeat scroll 0 0;
9+
color: #d02a13;
10+
font-family: Algerian;
11+
font-size: 20px;
12+
margin: 100px auto;
13+
text-align: center;
14+
width: 900px;
15+
}
16+
</style>
17+
</head>
18+
<body>
19+
<h1>JavaScript Fundamental Course</h1>
20+
<p>It is easy to learn & easy to code.</p>
21+
<script src="Array.js">
22+
</script>
23+
</body>
24+
</html>

Basic JS and HTML/Array.js

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
var ar = [];
2+
var ar2 = [10, 20, 35, 65, 911, 1, 0, 901];
3+
var ar3 = ['a','b','c','d'];
4+
var n = prompt("Enter array size: ");
5+
6+
for (i = 0; i < n; i++) {
7+
ar[i] = prompt("Enter array elements: ");
8+
}
9+
10+
ar.push('last'); // array.push(value) ফাংশনটি array এর শেষে এলিমেন্ট যোগ করে
11+
ar.unshift('0'); // array.unshift(value) ফাংশনটি array এর শুরুতে এলিমেন্ট যোগ করে
12+
ar.pop(); // array.pop() মেথড টি array এর লাস্ট এলিমেন্ট ডিলিট করবে
13+
ar.shift(); // array.shift() মেথড array এর ইনডেক্স এক ঘর আগে নিবে
14+
ar.splice(0, 2); // 0 থেকে 2 পর্যন্ত 2 টি এলিমেন্ট ডিলিট হবে
15+
ar.splice(1, 4, 'A', 'B', 'C', 'D'); // 1 থেকে 4 পর্যন্ত 4 টি এলিমেন্ট এ A,B,C,D রিপ্লেস হবে
16+
ar.reverse(); // array কে রিভার্স করবে
17+
ar.sort(); // array কে সর্ট করবে ( প্রথমে 0 থেকে 9 এরপর A থেকে Z অনুসারে )
18+
19+
for (i = 0; i < ar.length; i++) {
20+
alert(ar[i]);
21+
}
22+
23+
// ascending or descending order এ অ্যাকুরেট শো করবে
24+
ar2.sort(function (a, b) {
25+
if (a < b)
26+
return -1;
27+
else if (a === b)
28+
return 0;
29+
else
30+
return 1;
31+
});
32+
alert(ar2);
33+
34+
// join() function array কে string এ প্রিন্ট করে
35+
console.log(ar3);
36+
console.log(ar3.join());
37+
console.log(ar3.join(''));
38+
39+
// indexOf() function টি array element এর ইন্ডেক্স প্রিন্ট করে
40+
console.log(ar3.indexOf('d'));
41+
42+
// slice() function টি index 0 থেকে selected element পর্যন্ত ডিলিট করে
43+
console.log(ar3.slice(2));
44+
console.log(ar3.slice(-2)); // - sign দিলে শেষ থেকে তত সংখ্যক পর্যন্ত element exist থাকবে

Basic JS and HTML/DataType.html

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8" />
5+
<title></title>
6+
<style>
7+
body {
8+
background: #ddd none repeat scroll 0 0;
9+
color: #d02a13;
10+
font-family: Algerian;
11+
font-size: 20px;
12+
margin: 100px auto;
13+
text-align: center;
14+
width: 900px;
15+
}
16+
</style>
17+
</head>
18+
<body>
19+
<h1>JavaScript Fundamental Course</h1>
20+
<p>It is easy to learn & easy to code.</p>
21+
<script src="DataType.js">
22+
</script>
23+
</body>
24+
</html>

Basic JS and HTML/DataType.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+

2+
var number = 10
3+
var string = '\nHi ! this is Munna\n';
4+
var qoute = '"How are you ?"\n';
5+
var array = [5, "DIU", true];
6+
var object = {
7+
myID: 15,
8+
mySection: 'D'
9+
};
10+
object.myID;
11+
object['mySection'];
12+
//object.mySection;
13+
14+
alert(number + string + qoute + array + '\n' + object.myID + ' ' + object['mySection']);
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<!DOCTYPE html>
2+
<html xmlns="http://www.w3.org/1999/xhtml">
3+
<head>
4+
<title>JavaScript Class - 04</title>
5+
</head>
6+
<body>
7+
<div align="center">
8+
<h1>JavaScript Class - 04</h1>
9+
</div>
10+
11+
<script>
12+
// filter operation - ES6
13+
let words = [
14+
'Node.js', "is", "an", "open-source", "cross-platform", "JavaScript", "run-time",
15+
"environment", "that", "executes", "JavaScript", "code", "outside", "of", "a", "browser"
16+
];
17+
//let newarray = words.filter(m => m == "JavaScript")
18+
//document.write(newarray.length + "<br>" + newarray);
19+
20+
21+
// filter operation - ES5
22+
//let newarray = words.filter(function(m){
23+
// return m.length >= 7;
24+
//});
25+
//document.write(newarray + "<br>");
26+
27+
// for each loop operation
28+
//words.forEach (function(m){
29+
// if(m.length >= 7){
30+
// newarray.push(m);
31+
// //document.write(newarray + "<br>");
32+
// }
33+
//});
34+
//newarray.forEach(function(x){
35+
// document.write(x + "<br>");
36+
//});
37+
38+
</script>
39+
</body>
40+
</html>

Basic JS and HTML/Function 2.html

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8" />
5+
<title></title>
6+
<style>
7+
body {
8+
background: #ddd none repeat scroll 0 0;
9+
color: #d02a13;
10+
font-family: Algerian;
11+
font-size: 20px;
12+
margin: 100px auto;
13+
text-align: center;
14+
width: 900px;
15+
}
16+
</style>
17+
</head>
18+
<body>
19+
<h1>JavaScript Fundamental Course</h1>
20+
<p>It is easy to learn & easy to code.</p>
21+
<script src="Function 2.js">
22+
</script>
23+
</body>
24+
</html>

Basic JS and HTML/Function 2.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+

2+
console.log(myVariable);
3+
var myVariable = "Who are you ?";
4+
5+
(function newfunc() {
6+
console.log('Invoked automaticly');
7+
}());
8+
9+
!function newfunc2() {
10+
console.log('It is also invoked automaticly');
11+
}();
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8" />
5+
<title></title>
6+
<style>
7+
body {
8+
background: #ddd none repeat scroll 0 0;
9+
color: #d02a13;
10+
font-family: Algerian;
11+
font-size: 20px;
12+
margin: 100px auto;
13+
text-align: center;
14+
width: 900px;
15+
}
16+
</style>
17+
</head>
18+
<body>
19+
<h1>JavaScript Fundamental Course</h1>
20+
<p>It is easy to learn & easy to code.</p>
21+
<script src="Function with input from user.js">
22+
</script>
23+
</body>
24+
</html>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+

2+
var n1 = prompt("What is your name ?");
3+
var n2 = prompt("Enter password :");
4+
var n3 = prompt("Enter your favourite color :");
5+
6+
function func1(n) {
7+
var name = {
8+
munna: '\nRedwan Sharafat Kabir'
9+
};
10+
return name[n] || "\nPlease enter a valid username";
11+
}
12+
function func2(p) {
13+
var pass = {
14+
valo: '\nID: 171-15-8737'
15+
}
16+
return pass[p] || "\nInvalid password.";
17+
}
18+
var func3 = function func3(c) {
19+
var colors = {
20+
green: '\nSection- D'
21+
};
22+
return colors[c] || "\nInvalid Color.\nCan't remember your favourite choice ?";
23+
}
24+
25+
alert(func1(n1) + func2(n2) + func3(n3) );
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8" />
5+
<title>Javascript</title>
6+
<style>
7+
body {
8+
background: #ddd none repeat scroll 0 0;
9+
color: #d02a13;
10+
font-family: Algerian;
11+
font-size: 20px;
12+
margin: 100px auto;
13+
text-align: center;
14+
width: 900px;
15+
}
16+
</style>
17+
</head>
18+
<body>
19+
<h1>JavaScript Fundamental Course</h1>
20+
<p>It is easy to learn & easy to code.</p>
21+
<script>
22+
//let word1 = "Global";
23+
function variable() {
24+
//word1 = word1 + " variable";
25+
//var word1 = "Local variable";
26+
27+
// if the variable is not declared then it is automaticly a global variable
28+
word1 = "Global variable"
29+
document.write(`${word1} <br><br>`);
30+
}
31+
32+
variable();
33+
document.write(word1);
34+
</script>
35+
</body>
36+
</html>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<script>
5+
function processdata(inputstring) {
6+
return inputstring;
7+
}
8+
//var input = prompt();
9+
document.write('Hello, World.' + "<br/>" + processData(input = (prompt())) + "<br/>");
10+
//document.write('Hello, World.' + "<br/>" + input + "<br/>");
11+
</script>
12+
</head>
13+
<body>
14+
</body>
15+
</html>

Basic JS and HTML/Hello World.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8" />
5+
<title>JavaScript Fundamental</title>
6+
<script type= "text/javascript" src="Hello World.js">
7+
</script>
8+
</head>
9+
<body>
10+
<script type= "text/javascript">
11+
alert("Hello world" + output());
12+
</script>
13+
14+
</body>
15+
</html>

Basic JS and HTML/Hello World.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
function output() {
2+
return "\nThis is Munna";
3+
}

0 commit comments

Comments
 (0)