Practice Exercise
Question
- Create an Object that stores country name, capital, language, population, neighbours and create a describe function using get all output all these variables.
- Do This same with Constructors.
- Do Same with Classes and reuse it for USA.
Hint
For General
Create an Object names myCountry and assign the values of country to their respective variables.
example : country : 'India'
Now create a describe function that prints the value of assigned variables in Console by using this Statement.
Call the function inside the Object.
Note: Logic is Same in All Question, you just need to use specific Syntax for each case.
Solution (Object & Get)
Object With Constructor
Using Classes