Practice Set Advjs
Practice Set Advjs
1. Create an Animal class. The class will have name, age, color, legs properties and create different
methods
2. Create a Dog and Cat child class from the Animal Class.
-------------------------------------------------------------------------
4. const skills = ['HTML', 'CSS', 'JS', 'React','Node', 'Python'] Change skills array to JSON.
8. Stringify the students object with only firstName, lastName and skills properties
9. const txt = `{ "Alex": { "email": "[email protected]", "skills": [ "HTML", "CSS", "JavaScript" ], "age": 20,
"isLoggedIn": false, "points": 30 }, "Asab": { "email": "[email protected]", "skills": [ "HTML", "CSS",
"JavaScript", "Redux", "MongoDB", "Express", "React", "Node" ], "age": 25, "isLoggedIn": false,
"points": 50 }, "Brook": { "email": "[email protected]", "skills": [ "HTML", "CSS", "JavaScript",
"React", "Redux" ], "age": 30, "isLoggedIn": true, "points": 50 }, "Daniel": { "email":
"[email protected]", "skills": [ "HTML", "CSS", "JavaScript", "Python" ], "age": 20, "isLoggedIn": false,
"points": 40 }, "John": { "email": "[email protected]", "skills": [ "HTML", "CSS", "JavaScript", "React",
"Redux", "Node.js" ], "age": 20, "isLoggedIn": true, "points": 50 }, "Thomas": { "email":
"[email protected]", "skills": [ "HTML", "CSS", "JavaScript", "React" ], "age": 20, "isLoggedIn":
false, "points": 40 }, "Paul": { "email": "[email protected]", "skills": [ "HTML", "CSS", "JavaScript",
"MongoDB", "Express", "React", "Node" ], "age": 20, "isLoggedIn": false, "points": 40 } } `
10. Find the user who has many skills from the variable stored in txt.
------------------------------------------------------------------------------------
11. Read the countries API using fetch and print the name of country, capital, languages, population
and area. https://restcountries.com/v2/all
12. Print out all the cat names in to catNames variable. https://api.thecatapi.com/v1/breeds
---------------------------------------------------------------------------------
15. Create an index.html file and put four p elements as above: Get the first paragraph by using
document.querySelector(tagname) and tag name.
16. Get each of the the paragraph using document.querySelector('#id') and by their id
17. Get all the p as nodeList using document.querySelectorAll(tagname) and by their tag name
18. Loop through the nodeList and get the text content of each paragraph
20. Set id and class attribute for all the paragraphs using different attribute setting methods
21. Change stye of each paragraph using JavaScript(eg. color, background, border, font-size, font-
family)
22. Select all paragraphs and loop through each elements and give the first and third paragraph a
color of green, and the second and the fourth paragraph a red color