-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDay08.js
More file actions
33 lines (24 loc) · 858 Bytes
/
Day08.js
File metadata and controls
33 lines (24 loc) · 858 Bytes
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
// Problem Statement: You are given an object representing a book with properties
// such as title, author, and year. Your task is to use the for...in loop to traverse
// through the object and print each key along with its associated value in the format: key: value.
// Example Input:
// let book = { title: "The Hobbit", author: "J.R.R. Tolkien", year: 1937 };
// let book = { title: "Do epic shit", author: "Ankur warikoo", year: 2021 };
// for(let item in book)
// {
// console.log(`${item} : ${book[item]}`);
// }
// let arr = ['A','B','C','D','E','F'];
// let N = arr.length;
// let newarr = [];
// for(let i=0; i<N; i++)
// {
// if(i%2==0)
// {
// // let temp =0;
// newarr[i] = arr[i+1];
// newarr[i+1] = arr[i];
// }
// }
// console.log(newarr);
//write code here