Skip to content

Commit f0b273a

Browse files
committed
useState() Implemented but, Failed to get Result
1 parent 44a1849 commit f0b273a

File tree

9 files changed

+48
-1
lines changed

9 files changed

+48
-1
lines changed

Closures/Closures-Different-POVs/AKSHAY-SAINI.md

Whitespace-only changes.

Closures/Closures-Different-POVs/HITESH-CHOUDHARY.md

Whitespace-only changes.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### This is the compiled knowledge, I have gotten from all these wonderfull and amazing teachers in this JS World 🚀
2+
3+
# Closures : Function Object available in the Scope Chain 💯

Closures/Closures-Different-POVs/TECHSITH.md

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.

Functional-Components/Introduction/index.html

Whitespace-only changes.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
var state = null;
2+
3+
const useState = (initialState) => {
4+
state = initialState;
5+
6+
const setState = (param) => {
7+
useState(param);
8+
}
9+
10+
return [state, setState];
11+
};
12+
13+
const [number, setNumber] = useState(7);
14+
15+
console.log(number);
16+
17+
setNumber(9);
18+
19+
console.log(number)
20+

Prototype_Chaining-Prototypal_Inheritance/Array_Prototype/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ <h3>Array Prototype</h3>
1212
<li></li>
1313
</ul>
1414

15-
<script src="./Array.js" defer></script>
15+
<script src="./index.js" defer></script>
1616
</body>
1717
</html>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
function Student(name, age){
2+
this.name = name;
3+
this.age = age;
4+
this.getName = function(){
5+
return this.name;
6+
}
7+
this.setName = function(newName){
8+
this.name = newName;
9+
return this.name
10+
}
11+
12+
this.getAge = function(){
13+
return this.age;
14+
}
15+
this.setAge = function(newAge){
16+
this.age = newAge;
17+
}
18+
}
19+
20+
const Sandeep = new Student("Sandeep K. Dasari", 21);
21+
console.log(Sandeep.setName("Sandeep"));
22+
23+

0 commit comments

Comments
 (0)