-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathPractice03.js
More file actions
85 lines (63 loc) · 1.66 KB
/
Practice03.js
File metadata and controls
85 lines (63 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// function whosPaying(names) {
// return names[Math.floor(Math.random() * (names.length))];
// }
// console.log(whosPaying(["Angela", "Ben", "Jenny", "Michael", "Chloe"]))
// function fibonacciGenerator (n) {
// var output = [0,1];
// if (n===1){
// return [output[0]];
// }
// else if(n===2){
// return output;
// }
// else {
// for (var i=2; i<n; i++){
// var temp = output[output.length - 2] + output[output.length - 1];
// output.push(temp);
// }
// return output;
// }
// }
// console.log(fibonacciGenerator(5));
// function add(a, b)
// let temp = a + b;
// console.log(temp);
// add(5,6)
// a = [5,6,4,10];
// for (let i in Range(a.length)){
// console.log(a[i]);
// }
// arr = [4,5,3,8];
// console.log(arr.pop(4));
// console.log(arr);
// function sumOfAll() {
// let sum = 0;
// for (let i =0; i<arguments.length; i++){
// sum = sum + arguments.i;
// console.log(i);
// }
// console.log(sum);
// }
// sumOfAll(4,2,6);
// let args = {
// 1:4,
// name:2,
// 3:6
// }
// console.log(args[1]);
// console.log(args.name);
// (() => { // ANONYMUS FUNCTION, SELF INVOKED FUNCTION //
// console.log("hello world");
// })();
// "use strict";
// const prompt = require("prompt-sync")({sigint:true});
// let x = parseInt(prompt("Enter the number : "));
// console.log(typeof x);
// let array = [1, true, 'Sayantan', 4.5, undefined, null];
// console.log(array);
let obj = {
1: "sayantan",
key: "Ghosh",
};
console.log(obj[1]);
console.log(obj.key);