Skip to content

Commit 0809124

Browse files
author
Manthan Ankolekar
committed
updated
1 parent 9832b02 commit 0809124

File tree

5 files changed

+140
-0
lines changed

5 files changed

+140
-0
lines changed

README.md

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3470,6 +3470,125 @@ for (let i = 0; i < 8; i++) {
34703470
document.body.appendChild(chessboard);
34713471
```
34723472
3473+
Print the result for the code below
3474+
3475+
```javascript
3476+
var obj1 = {
3477+
num: 10
3478+
}
3479+
var obj2 = Object.create(obj1);
3480+
console.log(obj2.num);
3481+
3482+
// output: 10
3483+
```
3484+
3485+
Print the result for the code below
3486+
3487+
```javascript
3488+
var num = 10; var obj = {
3489+
num: 20
3490+
};
3491+
(function() {
3492+
console.log(num, obj.num);
3493+
})();
3494+
3495+
// output: 10 20
3496+
```
3497+
3498+
Print the result for the code below
3499+
3500+
```javascript
3501+
var num1 = 20;
3502+
var num2 = 30;
3503+
[num1, num2] [num2, num1];
3504+
console.log(num1, num2);
3505+
3506+
// output: 20 30
3507+
```
3508+
3509+
3510+
Print the result for the code below
3511+
3512+
```javascript
3513+
var num= 10;
3514+
var obj = {
3515+
num: 20,
3516+
printNum: function() {
3517+
console.log(this.num);
3518+
}
3519+
};
3520+
var newObj = obj.printNum.bind(obj);
3521+
newObj();
3522+
3523+
// output: 20
3524+
```
3525+
3526+
3527+
Print the result for the code below
3528+
3529+
```javascript
3530+
var num= 10;
3531+
var obj = {
3532+
num: 20,
3533+
printNum: function() {
3534+
console.log(this.num);
3535+
}
3536+
};
3537+
var newObj = obj.printNum.bind({ num: 30 });
3538+
newObj();
3539+
3540+
// output: 30
3541+
```
3542+
3543+
3544+
Print the result for the code below
3545+
3546+
```javascript
3547+
var person = {
3548+
name: "John",
3549+
greet: function() {
3550+
console.log("Hello, my name is "+this.name);
3551+
}
3552+
}
3553+
var newPerson = person;
3554+
newPerson.name = "Jane";
3555+
person.greet();
3556+
3557+
// output: Hello, my name is Jane
3558+
```
3559+
3560+
3561+
Print the result for the code below
3562+
3563+
```javascript
3564+
var num = 10;
3565+
var obj = {
3566+
num: 20
3567+
};
3568+
(function(num, obj) {
3569+
console.log(num, obj.num);
3570+
})(num, obj);
3571+
3572+
// output: 10 20
3573+
```
3574+
3575+
3576+
Print the result for the code below
3577+
3578+
```javascript
3579+
var num = 10;
3580+
var obj = {
3581+
num: 20,
3582+
printNum: function() {
3583+
console.log(this.num);
3584+
}
3585+
};
3586+
var newObj = obj.printNum;
3587+
newObj();
3588+
3589+
// output: 10
3590+
```
3591+
34733592
## List of GitHub Repositories to learn JavaScript
34743593
34753594
- [30 Days of JavaScript](https://github.com/Asabeneh/30-Days-Of-JavaScript)

nodejs.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
## Nodejs

public/index.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
7+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
8+
<title>Webpage</title>
9+
<link rel="stylesheet" href="/public/style.css">
10+
</head>
11+
12+
<body>
13+
<h1>Welcome to the Page</h1>
14+
<script src="/public/script.js"></script>
15+
</body>
16+
17+
</html>

public/script.js

Whitespace-only changes.

public/style.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
h1 {
2+
text-align: center;
3+
}

0 commit comments

Comments
 (0)