{"id":21696313,"url":"https://github.com/dinanathsj29/javascript-exercise-beginners","last_synced_at":"2025-07-23T06:05:07.696Z","repository":{"id":43898195,"uuid":"251088100","full_name":"dinanathsj29/javascript-exercise-beginners","owner":"dinanathsj29","description":"Lets go-through, learn and understand different logical Javascript exercises and algorithms for beginners.","archived":false,"fork":false,"pushed_at":"2020-04-06T06:10:32.000Z","size":5020,"stargazers_count":168,"open_issues_count":0,"forks_count":56,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-08T16:21:14.314Z","etag":null,"topics":["array-count-search-occurances","array-filter-sort-map","array-get-max-largest-number","fizzbuzz-algorithms","javascript-algorithms","javascript-dom-object-array","javascript-es5-es6-examples","javascript-examples","javascript-examples-beginners","javascript-exercises","javascript-logical-examples","javascript-logical-loop-condition","javascript-practical-examples","javascript-practice-examples","javascript-var-let-const-function","number-loop","object-create-factory-constructor","object-equality","random-bingo-card","show-prime-numbers"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dinanathsj29.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-29T17:15:18.000Z","updated_at":"2025-03-11T04:04:08.000Z","dependencies_parsed_at":"2022-08-28T18:42:21.431Z","dependency_job_id":null,"html_url":"https://github.com/dinanathsj29/javascript-exercise-beginners","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dinanathsj29/javascript-exercise-beginners","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinanathsj29%2Fjavascript-exercise-beginners","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinanathsj29%2Fjavascript-exercise-beginners/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinanathsj29%2Fjavascript-exercise-beginners/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinanathsj29%2Fjavascript-exercise-beginners/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dinanathsj29","download_url":"https://codeload.github.com/dinanathsj29/javascript-exercise-beginners/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinanathsj29%2Fjavascript-exercise-beginners/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265133596,"owners_count":23716387,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["array-count-search-occurances","array-filter-sort-map","array-get-max-largest-number","fizzbuzz-algorithms","javascript-algorithms","javascript-dom-object-array","javascript-es5-es6-examples","javascript-examples","javascript-examples-beginners","javascript-exercises","javascript-logical-examples","javascript-logical-loop-condition","javascript-practical-examples","javascript-practice-examples","javascript-var-let-const-function","number-loop","object-create-factory-constructor","object-equality","random-bingo-card","show-prime-numbers"],"created_at":"2024-11-25T19:19:26.322Z","updated_at":"2025-07-23T06:05:07.664Z","avatar_url":"https://github.com/dinanathsj29.png","language":"JavaScript","readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"_images-javascript-exercise-beginners/javascript-logo-4.png\" alt=\"JavaScript logo\" title=\"JavaScript beginners exercises\" width=\"200\" /\u003e\n\u003c/p\u003e\n\nJavaScript Essential exercise for Beginners\n=====================\nJavaScript exercise/examples for Beginners\n=====================\n\n## 01. What is JavaScript?\n\n- JavaScript is a programming language that adds interactivity to Web pages\n- JavaScript is a scripting language\n- A JavaScript script is a program that is included on an HTML page\n- JavaScript scripts are text on Web pages that are interpreted and run by Web browsers\n- JavaScript is initially named and developed as `LiveScript` at Netscape Navigator Corporation\n- JavaScript is `not Java`\n- Due to Java wave or Java popularity and buzz, `LiveScript` renamed to `JavaScript`\n\n## 02. What can JavaScript do?\n\n- Create an active User Interface\n- Control the user experience based on Day, Date, Time and Browser, etc\n- Validate user input on forms\n- Create custom HTML pages on the fly/dynamically\n- Control Web browsers interactivity and behaviors\n\n## 03. What can't JavaScript do?\n\n- JavaScript can't talk to a Database (Its possible with NodeJs)\n- JavaScript can't write to files (Its possible with NodeJs)\n- Keep track of state (except with cookies)\n\nTopics include\n=====================\n1. [Example 1 - swapping variables](#example-1-swapping-variables)\n2. [Example 2 - max number](#example-2-max-number)\n3. [Example 3 - Landscape Portrait](#example-3-landscape-portrait)\n4. [Example 4 - FizzBuzz Algorithms](#example-4-fizzbuzz-algorithms)\n5. [Example 5 - Speed Limits](#example-5-speed-limits)\n6. [Example 6 - Odd Even Number Loop](#example-6-odd-even-number-loop)\n7. [Example 7 - Count Truthy Falsy Values](#example-7-count-truthy-falsy-values)\n8. [Example 8 - Object String Properties Key](#example-8-object-string-properties-key)\n9. [Example 9 - Sum of Multiples](#example-9-sum-of-multiples)\n10. [Example 10 - Netsted Loop Star Pattern](#example-10-netsted-loop-star-pattern)\n11. [Example 11 - Marks Average Grade](#example-11-marks-average-grade)\n12. [Example 12 - Random Bingo Card](#example-12-random-bingo-card)\n13. [Example 13 - Show Prime Numbers](#example-13-show-prime-numbers)\n14. [Example 14 - Sum Of Arguments](#example-14-sum-of-arguments)\n15. [Example 15 - Sum Of Arguments Array](#example-15-sum-of-arguments-array)\n16. [Example 16 - Circle Area Object Read Only Property](#example-16-circle-area-object-read-only-property)\n17. [Example 17 - Create Array From Argument Range](#example-17-create-array-from-argument-range)\n18. [Example 18 - Array Includes Element Exists](#example-18-array-includes-element-exists)\n19. [Example 19 - Array Excludes Value To New Array](#example-19-array-excludes-value-to-new-array)\n20. [Example 20 - Array Count Search Occurances](#example-20-array-count-search-occurances)\n21. [Example 21 - Array Get Max Largest Number](#example-21-array-get-max-largest-number)\n22. [Example 22 - Array Filter Sort Map](#example-22-array-filter-sort-map)\n23. [Example 23 - Object Create Students and Address Object](#example-23-object-create-students-and-address-object)\n24. [Example 24 - Object Create Object Factory Constructor Function](#example-24-object-create-object-factory-constructor-function)\n25. [Example 25 - Object Equality](#example-25-object-equality)\n\nExample 1 swapping variables\n=====================\n\n\u003cp\u003e\n  \u003cfigure\u003e\n    \u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cimg src=\"_images-javascript-exercise-beginners/1-swapping-variables.png\" alt=\"Swapping Variables\" title=\"Swapping Variables\" width=\"1000\" border=\"2\" /\u003e\n    \u003cfigcaption\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp; Image 1 - Swapping Variables\u003c/figcaption\u003e\n  \u003c/figure\u003e\n\u003c/p\u003e\n\n\u003e **Syntax \u0026 Example**: `1-swapping-variables.html`\n```html\n\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n\u003chead\u003e\n  \u003cmeta charset=\"UTF-8\"\u003e\n  \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"\u003e\n  \u003ctitle\u003eswapping-variables\u003c/title\u003e\n  \u003clink rel=\"stylesheet\" type=\"text/css\" href=\"../style.css\" /\u003e\n\u003c/head\u003e\n\u003cbody\u003e \n  \n  \u003ch1\u003e1-swapping-variables!\u003c/h1\u003e\n\n  \u003ch3\u003eSwap the values of variable\u003c/h3\u003e\n  \n  \u003cscript type=\"text/javascript\" src=\"script.js\"\u003e\u003c/script\u003e\n\n\u003c/body\u003e\n\u003c/html\u003e\n\n```\n\n\u003e **Syntax \u0026 Example**: `script.js`\n```js\n\nconsole.log('1-swapping-variables');\n\nlet value1 = 'one';\nlet value2 = 'two';\n\n// original values\nconsole.log('original', value1);\nconsole.log('original', value2);\n\n// swapping values\nlet value3 = value1;\nvalue1 = value2;\nvalue2 = value3;\n\nconsole.log('swap', value1);\nconsole.log('swap', value2);\n\n```\n\n\u003e **Syntax \u0026 Example**: global `style.css`\n```css\n\nbody{\n  font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;\n}\n\nh1, th{\n  font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;\n}\n\ntable{\n  /* border: 2px solid #696969;\n  border-collapse: collapse; */\n  font-size: 18px;\n}\n\nth{\n  width: 20%;\n}\n\nth, td{\n  padding: 10px;\n  border: 2px solid #696969;\n  text-align: center;\n}\n\n#freeSquare{\n  background-color: coral;\n}\n\n```\n\nExample 2 max number\n=====================\n\n\u003cp\u003e\n  \u003cfigure\u003e\n    \u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cimg src=\"_images-javascript-exercise-beginners/2-max-number.png\" alt=\"Max Number\" title=\"Max Number\" width=\"1000\" border=\"2\" /\u003e\n    \u003cfigcaption\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp; Image 2 - Max Number\u003c/figcaption\u003e\n  \u003c/figure\u003e\n\u003c/p\u003e\n\n\u003e **Syntax \u0026 Example**: `2-max-number.html`\n```html\n\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n\u003chead\u003e\n  \u003cmeta charset=\"UTF-8\"\u003e\n  \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"\u003e\n  \u003ctitle\u003emax-number\u003c/title\u003e\n  \u003clink rel=\"stylesheet\" type=\"text/css\" href=\"../style.css\" /\u003e\n\u003c/head\u003e\n\u003cbody\u003e \n  \n  \u003ch1\u003e2-max-number!\u003c/h1\u003e\n\n  \u003ch3\u003eWrite a function which returns the maximum of two number\u003c/h3\u003e\n  \n  \u003cscript type=\"text/javascript\" src=\"script.js\"\u003e\u003c/script\u003e\n\n\u003c/body\u003e\n\u003c/html\u003e\n\n```\n\n\u003e **Syntax \u0026 Example**: `script.js`\n```js\n\nconsole.log('2-max-number');\n\nfunction findMaxNumber(num1, num2){\n  // 1. long syntax\n  /* if(num1 \u003e num2){\n    return num1\n  } else {\n    return num2\n  } */\n\n  // 2. short syntax\n  /* if(num1 \u003e num2) return num1;\n  else return num2; */\n\n  // 3. ternary short syntax\n  return (num1 \u003e num2) ? num1 : num2;\n}\n\nlet checkMax1 = findMaxNumber(10, 5);\nconsole.log('Max Number:',checkMax1);\n\nlet checkMax2 = findMaxNumber(10, 15);\nconsole.log('Max Number:',checkMax2);\n\nlet checkMax3 = findMaxNumber(100, 100);\nconsole.log('Max Number:',checkMax3);\n\n```\n\nExample 3 Landscape Portrait\n=====================\n\n\u003cp\u003e\n  \u003cfigure\u003e\n    \u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cimg src=\"_images-javascript-exercise-beginners/3-landscape-portrait.png\" alt=\"Landscape Portrait\" title=\"Landscape Portrait\" width=\"1000\" border=\"2\" /\u003e\n    \u003cfigcaption\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp; Image 3 - Landscape Portrait\u003c/figcaption\u003e\n  \u003c/figure\u003e\n\u003c/p\u003e\n\n\u003e **Syntax \u0026 Example**: `3-landscape-portrait.html`\n```html\n\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n\u003chead\u003e\n  \u003cmeta charset=\"UTF-8\"\u003e\n  \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"\u003e\n  \u003ctitle\u003elandscape-portrait\u003c/title\u003e\n  \u003clink rel=\"stylesheet\" type=\"text/css\" href=\"../style.css\" /\u003e\n\u003c/head\u003e\n\u003cbody\u003e \n  \n  \u003ch1\u003e3-landscape-portrait!\u003c/h1\u003e\n\n  \u003ch3\u003eWrite a function which checks given width and height, returns true (landscape) if width is greater than height and vice versa\u003c/h3\u003e\n  \n  \u003cscript type=\"text/javascript\" src=\"script.js\"\u003e\u003c/script\u003e\n\n\u003c/body\u003e\n\u003c/html\u003e\n\n```\n\n\u003e **Syntax \u0026 Example**: `script.js`\n```js\n\nconsole.log('3-landscape-portrait');\n\nfunction isLandscape(width, height){\n  // 3. ternary short syntax\n  return (width \u003e height);\n}\n\nlet checkWidthHeight1 = isLandscape(800, 600);\nconsole.log('Landscape:',checkWidthHeight1);\n\nlet checkWidthHeight2 = isLandscape(600, 800);\nconsole.log('Landscape:',checkWidthHeight2);\n\nlet checkWidthHeight3 = isLandscape(1024, 768);\nconsole.log('Landscape:',checkWidthHeight3);\n\n```\n\nExample 4 FizzBuzz Algorithms\n=====================\n\n\u003cp\u003e\n  \u003cfigure\u003e\n    \u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cimg src=\"_images-javascript-exercise-beginners/4-fizzbuzz-algorithms.png\" alt=\"Fizzbuzz Algorithms\" title=\"Fizzbuzz Algorithms\" width=\"1000\" border=\"2\" /\u003e\n    \u003cfigcaption\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp; Image 4 - Ffizzbuz Algorithms\u003c/figcaption\u003e\n  \u003c/figure\u003e\n\u003c/p\u003e\n\n\u003e **Syntax \u0026 Example**: `4-fizzbuzz-algorithms.html`\n```html\n\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n\u003chead\u003e\n  \u003cmeta charset=\"UTF-8\"\u003e\n  \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"\u003e\n  \u003ctitle\u003efizzbuzz-algorithms\u003c/title\u003e\n  \u003clink rel=\"stylesheet\" type=\"text/css\" href=\"../style.css\" /\u003e\n\u003c/head\u003e\n\u003cbody\u003e \n  \n  \u003ch1\u003e4-fizzbuzz-algorithms!\u003c/h1\u003e\n\n  \u003ch3\u003eWrite a function which checks given input/parameter:\u003c/h3\u003e\n  \n  \u003cul\u003e\n    \u003cli\u003eIf input/parameter is divisible by 3 print =\u003e Fizz\u003c/li\u003e\n    \u003cli\u003eIf input/parameter is divisible by 5 print =\u003e Buzz\u003c/li\u003e\n    \u003cli\u003eIf input/parameter is divisible by 3 or 5 print =\u003e FizzBuzz\u003c/li\u003e\n    \u003cli\u003eIf input/parameter is NOT divisible by 3 or 5 print =\u003e given Input Number/Value\u003c/li\u003e\n    \u003cli\u003eIf input/parameter is other than Number/Value print =\u003e 'Nan - Not a Number! Please Input Number' \u003c/li\u003e\n  \u003c/ul\u003e\n  \n  \u003cscript type=\"text/javascript\" src=\"script.js\"\u003e\u003c/script\u003e\n\n\u003c/body\u003e\n\u003c/html\u003e\n\n```\n\n\u003e **Syntax \u0026 Example**: `script.js`\n```js\n\nconsole.log('4-fizzbuzz-algorithms');\n\n/* \n\u003ch3\u003eWrite a function which checks given input/parameter:\u003c/h3\u003e\n\n\u003cul\u003e\n  \u003cli\u003eIf input/parameter is divisible by 3 print =\u003e Fizz\u003c/li\u003e\n  \u003cli\u003eIf input/parameter is divisible by 5 print =\u003e Buzz\u003c/li\u003e\n  \u003cli\u003eIf input/parameter is divisible by 3 or 5 print =\u003e FizzBuzz\u003c/li\u003e\n  \u003cli\u003eIf input/parameter is NOT divisible by 3 or 5 print =\u003e given Input Number/Value\u003c/li\u003e\n  \u003cli\u003eIf input/parameter is other than Number/Value print =\u003e 'Nan - Not a Number! Please Input Number' \u003c/li\u003e\n\u003c/ul\u003e\n*/\n\nfunction isfizzBuzz(arg){\n  if(typeof arg !== 'number'){\n    return ('Nan - Not a Number! Please Input Number');\n  }\n\n  if((arg % 3 === 0) \u0026\u0026 (arg % 5 === 0)) {\n    return 'FizzBuzz';\n  }\n\n  if(arg % 3 === 0) {\n    return 'Fizz';\n  }\n\n  if(arg % 5 === 0) {\n    return 'Buzz';\n  }\n\n  else {\n    return 'Some odd number entered: ' + arg;\n  }\n\n}\n\nlet checkFizzBuzz1 = isfizzBuzz('one');\nconsole.log(checkFizzBuzz1);\n\nlet checkFizzBuzz2 = isfizzBuzz(true);\nconsole.log(checkFizzBuzz2);\n\nlet checkFizzBuzz3 = isfizzBuzz(9);\nconsole.log(checkFizzBuzz3);\n\nlet checkFizzBuzz4 = isfizzBuzz(10);\nconsole.log(checkFizzBuzz4);\n\nlet checkFizzBuzz5 = isfizzBuzz(30);\nconsole.log(checkFizzBuzz5);\n\nlet checkFizzBuzz6 = isfizzBuzz(11);\nconsole.log(checkFizzBuzz6);\n\n```\n\nExample 5 Speed Limits\n=====================\n\n\u003cp\u003e\n  \u003cfigure\u003e\n    \u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cimg src=\"_images-javascript-exercise-beginners/5-speed-limits.png\" alt=\"Speed Limits\" title=\"Speed Limits\" width=\"1000\" border=\"2\" /\u003e\n    \u003cfigcaption\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp; Image 5 - Speed Limits\u003c/figcaption\u003e\n  \u003c/figure\u003e\n\u003c/p\u003e\n\n\u003e **Syntax \u0026 Example**: `5-speed-limits.html`\n```html\n\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n\u003chead\u003e\n  \u003cmeta charset=\"UTF-8\"\u003e\n  \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"\u003e\n  \u003ctitle\u003espeed-limits\u003c/title\u003e\n  \u003clink rel=\"stylesheet\" type=\"text/css\" href=\"../style.css\" /\u003e\n\u003c/head\u003e\n\u003cbody\u003e \n  \n  \u003ch1\u003e5-speed-limits!\u003c/h1\u003e\n\n  \u003ch3\u003eWrite a function which checks given input/parameter:\u003c/h3\u003e\n  \n  \u003cul\u003e\n    \u003cli\u003eIf input/parameter is below speedlimit of 70 print =\u003e 'Good Safe Driving'\u003c/li\u003e\n    \u003cli\u003eIf input/parameter is above speedlimit of 70, every 5 kilometers is Penalty Point, print =\u003e 'Speed Limit Crossed by Penalty Point' + Point \u003c/li\u003e\n    \u003cli\u003eIf Driver gets more than 10 penalty points ie. above the speed limit 120, print =\u003e 'License Suspended'\u003c/li\u003e\n  \u003c/ul\u003e\n  \n  \u003cscript type=\"text/javascript\" src=\"script.js\"\u003e\u003c/script\u003e\n\n\u003c/body\u003e\n\u003c/html\u003e\n\n```\n\n\u003e **Syntax \u0026 Example**: `script.js`\n```js\n\nconsole.log('5-speed-limits');\n\n/* \n\u003ch3\u003eWrite a function which checks given input/parameter:\u003c/h3\u003e\n  \n\u003cul\u003e\n  \u003cli\u003eIf input/parameter is below speedlimit of 70 print =\u003e 'Good Safe Driving'\u003c/li\u003e\n  \u003cli\u003eIf input/parameter is above speedlimit of 70, every 5 kilometers is Penalty Point, print =\u003e 'Speed Limit Crossed by Penalty Point' + Point \u003c/li\u003e\n  \u003cli\u003eIf Driver gets more than 10 penalty points ie. above the speed limit 120, print =\u003e 'License Suspended'\u003c/li\u003e\n\u003c/ul\u003e\n*/\n\nconst SPEEDLIMIT = 70;\nconst KMPERPOINT = 5;\n\nfunction checkSpeedLimit(curSpeed) {\n  if (curSpeed \u003c= SPEEDLIMIT) {\n    return ('Good Safe Driving!');\n  } else {\n    let penaltyPoint = Math.floor((curSpeed - SPEEDLIMIT) / KMPERPOINT);\n    if (penaltyPoint \u003c 10) {\n      return ('Speed Limit Crossed by Penalty Point: ' + penaltyPoint);\n    } else {\n      return ('License Suspended!');\n    }\n  }\n}\n\nlet checkPoin1 = checkSpeedLimit(40);\nconsole.log(checkPoin1);\n\nlet checkPoin2 = checkSpeedLimit(70);\nconsole.log(checkPoin2);\n\nlet checkPoin3 = checkSpeedLimit(75);\nconsole.log(checkPoin3);\n\nlet checkPoin4 = checkSpeedLimit(99);\nconsole.log(checkPoin4);\n\nlet checkPoin5 = checkSpeedLimit(120);\nconsole.log(checkPoin5);\n\n```\n\nExample 6 Odd Even Number Loop\n=====================\n\n\u003cp\u003e\n  \u003cfigure\u003e\n    \u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cimg src=\"_images-javascript-exercise-beginners/6-odd-even-number-loop.png\" alt=\"Odd Even Number Loop\" title=\"Odd Even Number Loop\" width=\"1000\" border=\"2\" /\u003e\n    \u003cfigcaption\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp; Image 6 - Odd Even Number Loop\u003c/figcaption\u003e\n  \u003c/figure\u003e\n\u003c/p\u003e\n\n\u003e **Syntax \u0026 Example**: `6-odd-even-number-loop.html`\n```html\n\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n\u003chead\u003e\n  \u003cmeta charset=\"UTF-8\"\u003e\n  \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"\u003e\n  \u003ctitle\u003eodd-even-number-loop\u003c/title\u003e\n  \u003clink rel=\"stylesheet\" type=\"text/css\" href=\"../style.css\" /\u003e\n\u003c/head\u003e\n\u003cbody\u003e \n  \n  \u003ch1\u003e6-odd-even-number-loop!\u003c/h1\u003e\n\n  \u003ch3\u003eWrite a function which checks number till given input/parameter is odd or even\u003c/h3\u003e\n\n  \u003cscript type=\"text/javascript\" src=\"script.js\"\u003e\u003c/script\u003e\n\n\u003c/body\u003e\n\u003c/html\u003e\n\n```\n\n\u003e **Syntax \u0026 Example**: `script.js`\n```js\n\nconsole.log('6-odd-even-number-loop');\n\nfunction isOddEvenNumber(curLimit) {\n  for(let i = 0; i \u003c= curLimit; i++) {\n    /* if (i % 2 === 0) {\n      console.log(i , 'EVEN');\n    } else {\n      console.log(i , 'ODD');\n    } */\n\n    const alertMessage = (i % 2 === 0) ? 'EVEN' : 'ODD';\n    console.log(i , alertMessage);\n  }\n}\n\nisOddEvenNumber(10);\n// isOddEvenNumber(17);\n\n```\n\nExample 7 Count Truthy Falsy Values\n=====================\n\n\u003cp\u003e\n  \u003cfigure\u003e\n    \u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cimg src=\"_images-javascript-exercise-beginners/7-count-truthy-falsy-values.png\" alt=\"Count Truthy Falsy Values\" title=\"Count Truthy Falsy Values\" width=\"1000\" border=\"2\" /\u003e\n    \u003cfigcaption\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp; Image 7 - Count Truthy Falsy Values\u003c/figcaption\u003e\n  \u003c/figure\u003e\n\u003c/p\u003e\n\n\u003e **Syntax \u0026 Example**: `7-count-truthy-falsy-values.html`\n```html\n\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n\u003chead\u003e\n  \u003cmeta charset=\"UTF-8\"\u003e\n  \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"\u003e\n  \u003ctitle\u003ecount-truthy-falsy-values.html\u003c/title\u003e\n  \u003clink rel=\"stylesheet\" type=\"text/css\" href=\"../style.css\" /\u003e\n\u003c/head\u003e\n\u003cbody\u003e \n  \n  \u003ch1\u003e7-count-truthy-falsy-values!\u003c/h1\u003e\n\n  \u003ch3\u003eWrite a function which checks and count the truthy values from an array\u003c/h3\u003e\n\n  Falsy values in JavaScript are:\n  \u003cul\u003e\n    \u003cli\u003efalse\u003c/li\u003e\n    \u003cli\u003e0 (zero)\u003c/li\u003e\n    \u003cli\u003eundefined\u003c/li\u003e\n    \u003cli\u003enull\u003c/li\u003e\n    \u003cli\u003e''\u003c/li\u003e\n    \u003cli\u003eNaN\u003c/li\u003e\n  \u003c/ul\u003e\n\n  \u003cscript type=\"text/javascript\" src=\"script.js\"\u003e\u003c/script\u003e\n\n\u003c/body\u003e\n\u003c/html\u003e\n\n```\n\n\u003e **Syntax \u0026 Example**: `script.js`\n```js\n\nconsole.log('7-count-truthy-falsy-values');\n\n/*\n\u003ch3\u003eWrite a function which checks and count the truthy values from an array\u003c/h3\u003e\n\nFalsy values in JavaScript are:\n\u003cul\u003e\n  \u003cli\u003efalse\u003c/li\u003e\n  \u003cli\u003e0 (zero)\u003c/li\u003e\n  \u003cli\u003eundefined\u003c/li\u003e\n  \u003cli\u003enull\u003c/li\u003e\n  \u003cli\u003e''\u003c/li\u003e\n  \u003cli\u003eNaN\u003c/li\u003e\n\u003c/ul\u003e\n*/\n\nconst valuesArray = [0, 1, '', undefined, false, true];\n\nfunction checkCountTruthyFalsy(curArray) {\n  let truthyCount = 0;\n  \n  for (let value of curArray) {\n    // no need to check if(value !== false || value !== 0 || value !== '' or ...)\n    if (value) {\n      truthyCount++;\n    }\n  }\n  return truthyCount;\n}\n\nconsole.log(checkCountTruthyFalsy(valuesArray));\n\n```\n\nExample 8 Object String Properties Key\n=====================\n\n\u003cp\u003e\n  \u003cfigure\u003e\n    \u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cimg src=\"_images-javascript-exercise-beginners/8-object-string-properties-key.png\" alt=\"Object String Properties Key\" title=\"Object String Properties Key\" width=\"1000\" border=\"2\" /\u003e\n    \u003cfigcaption\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp; Image 8 - Object String Properties Key\u003c/figcaption\u003e\n  \u003c/figure\u003e\n\u003c/p\u003e\n\n\u003e **Syntax \u0026 Example**: `8-object-string-properties-key.html`\n```html\n\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n\u003chead\u003e\n  \u003cmeta charset=\"UTF-8\"\u003e\n  \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"\u003e\n  \u003ctitle\u003eobject-string-properties-key\u003c/title\u003e\n  \u003clink rel=\"stylesheet\" type=\"text/css\" href=\"../style.css\" /\u003e\n\u003c/head\u003e\n\u003cbody\u003e \n  \n  \u003ch1\u003e8-object-string-properties-key!\u003c/h1\u003e\n\n  \u003ch3\u003eWrite a function which checks and prints only the string type properties of an object\u003c/h3\u003e\n\n  \u003cscript type=\"text/javascript\" src=\"script.js\"\u003e\u003c/script\u003e\n\n\u003c/body\u003e\n\u003c/html\u003e\n\n```\n\n\u003e **Syntax \u0026 Example**: `script.js`\n```js\n\nconsole.log('8-object-string-properties-key');\n\nfunction showStringProperties(curObj) {\n  for(let key in curObj) {\n    // console.log('key/prop:', key);\n    if(typeof(curObj[key]) === 'string') {\n      console.log(key,':', curObj[key]);\n    }\n  }\n}\n\nconst Person = {\n  name: 'Dinanath',\n  age: 40,\n  height: 5.6,\n  country: 'India',\n  designation: 'UI Developer'\n}\n\nshowStringProperties(Person);\nconsole.log('----------');\n\nconst Technology = {\n  name: 'JavaScipt',\n  version: 6,\n  purpose: 'Scripting language for Web',\n  developer: 'Netscape Corporation'\n}\n\nshowStringProperties(Technology);\nconsole.log('----------');\n\n```\n\nExample 9 Sum of Multiples\n=====================\n\n\u003cp\u003e\n  \u003cfigure\u003e\n    \u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cimg src=\"_images-javascript-exercise-beginners/9-sum-of-multiples.png\" alt=\"Sum of Multiples\" title=\"Sum of Multiples\" width=\"1000\" border=\"2\" /\u003e\n    \u003cfigcaption\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp; Image 9 - Sum of Multiples\u003c/figcaption\u003e\n  \u003c/figure\u003e\n\u003c/p\u003e\n\n\u003e **Syntax \u0026 Example**: `9-sum-of-multiples.html`\n```html\n\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n\u003chead\u003e\n  \u003cmeta charset=\"UTF-8\"\u003e\n  \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"\u003e\n  \u003ctitle\u003esum-of-multiples\u003c/title\u003e\n  \u003clink rel=\"stylesheet\" type=\"text/css\" href=\"../style.css\" /\u003e\n\u003c/head\u003e\n\u003cbody\u003e \n  \n  \u003ch1\u003e9-sum-of-multiples!\u003c/h1\u003e\n\n  \u003ch3\u003eWrite a function which Calculate the sum of multiples of 3 and 5 for a given limit\u003c/h3\u003e\n\n  \u003cscript type=\"text/javascript\" src=\"script.js\"\u003e\u003c/script\u003e\n\n\u003c/body\u003e\n\u003c/html\u003e\n\n```\n\n\u003e **Syntax \u0026 Example**: `script.js`\n```js\n\nconsole.log('9-sum-of-multiples');\n\nfunction sumOfMultiples(curLimit) {\n\n  let sumOfMultipleValue = 0;\n\n  for(let i = 0; i \u003c= curLimit; i++) {\n    if (i % 3 === 0 || i % 5 === 0) {\n      // console.log(i);\n      sumOfMultipleValue +=i;\n    }\n  }\n  // return sumOfMultipleValue;\n  console.log(`sumOfMultipleValue of 3 \u0026 5 upto ${curLimit} digit is:`, sumOfMultipleValue);\n}\n\nsumOfMultiples(10);\n\n```\n\nExample 10 Netsted Loop Star Pattern\n=====================\n\n\u003cp\u003e\n  \u003cfigure\u003e\n    \u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cimg src=\"_images-javascript-exercise-beginners/10-netsted-loop-star-pattern.png\" alt=\"Netsted Loop Star Pattern\" title=\"Netsted Loop Star Pattern\" width=\"1000\" border=\"2\" /\u003e\n    \u003cfigcaption\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp; Image 10 - Netsted Loop Star Pattern\u003c/figcaption\u003e\n  \u003c/figure\u003e\n\u003c/p\u003e\n\n\u003e **Syntax \u0026 Example**: `10-netsted-loop-star-pattern.html`\n```html\n\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n\u003chead\u003e\n  \u003cmeta charset=\"UTF-8\"\u003e\n  \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"\u003e\n  \u003ctitle\u003e10-netsted-loop-star-pattern\u003c/title\u003e\n  \u003clink rel=\"stylesheet\" type=\"text/css\" href=\"../style.css\" /\u003e\n\u003c/head\u003e\n\u003cbody\u003e \n  \n  \u003ch1\u003e10-netsted-loop-star-pattern!\u003c/h1\u003e\n\n  \u003ch3\u003eWrite a function which Prints/Shows star-aestrikes (or any pattern) for the number of times and rows provided\u003c/h3\u003e\n\n  \u003cscript type=\"text/javascript\" src=\"script.js\"\u003e\u003c/script\u003e\n\n\u003c/body\u003e\n\u003c/html\u003e\n\n```\n\n\u003e **Syntax \u0026 Example**: `script.js`\n```js\n\nconsole.log('10-netsted-loop-star-pattern');\n\nfunction showPattern(totalRowsPatternCount) {\n  for (let curRow = 1; curRow \u003c= totalRowsPatternCount; curRow++) {\n    // console.log(curRow);\n    let patternDesign = '';\n    for (let i = 0; i \u003c curRow; i++) {\n      patternDesign += '*'\n    }\n    console.log(patternDesign);\n  }\n}\n\nshowPattern(5);\n\n```\n\nExample 11 Marks Average Grade\n=====================\n\n\u003cp\u003e\n  \u003cfigure\u003e\n    \u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cimg src=\"_images-javascript-exercise-beginners/11-marks-average-grade.png\" alt=\"Marks Average Grade\" title=\"Marks Average Grade\" width=\"1000\" border=\"2\" /\u003e\n    \u003cfigcaption\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp; Image 11 - Marks Average Grade\u003c/figcaption\u003e\n  \u003c/figure\u003e\n\u003c/p\u003e\n\n\u003e **Syntax \u0026 Example**: `11-marks-average-grade.html`\n```html\n\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n\u003chead\u003e\n  \u003cmeta charset=\"UTF-8\"\u003e\n  \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"\u003e\n  \u003ctitle\u003emarks-average-grade\u003c/title\u003e\n  \u003clink rel=\"stylesheet\" type=\"text/css\" href=\"../style.css\" /\u003e\n\u003c/head\u003e\n\u003cbody\u003e \n  \n  \u003ch1\u003e11-marks-average-grade!\u003c/h1\u003e\n\n  \u003ch3\u003eWrite a function which Calculate the sum of marks provided in an array, average it and also show Grade\u003c/h3\u003e\n\n  Grade criteria/mechanism is:\n  \u003cul\u003e\n    \u003cli\u003e0% to 70% =\u003e D Grade\u003c/li\u003e\n    \u003cli\u003e71% to 79% =\u003e C Grade\u003c/li\u003e\n    \u003cli\u003e81% to 89% =\u003e B Grade\u003c/li\u003e\n    \u003cli\u003e91% to 100% =\u003e A Grade\u003c/li\u003e\n  \u003c/ul\u003e\n\n  \u003cscript type=\"text/javascript\" src=\"script.js\"\u003e\u003c/script\u003e\n\n\u003c/body\u003e\n\u003c/html\u003e\n\n```\n\n\u003e **Syntax \u0026 Example**: `script.js`\n```js\n\nconsole.log('11-marks-average-grade');\n\n// approach 1\n\n/* const MARKSARRAY = [55, 85, 55, 65];\n\nfunction calculateAverageGrade(currentMarks) {\n  let totalMarks = 0;\n  let averageMarks = 0;\n  let grade;\n\n  for(let mark of currentMarks) {\n    totalMarks += mark;\n  }\n  // console.log('totalMarks:', totalMarks);\n  averageMarks = (totalMarks/currentMarks.length);\n  // console.log('averageMarks:', averageMarks);\n\n  if(averageMarks \u003c 70) return grade = 'D'; \n  if(averageMarks \u003c 80) return grade = 'C';\n  if(averageMarks \u003c 90) return grade = 'B';\n  if(averageMarks \u003c= 100) return grade = 'A';\n}\n\nconsole.log('Grade:', calculateAverageGrade(MARKSARRAY)); */\n\n// approach 2 - create two different functions with single responsibility principle\n\nconst MARKSARRAY = [55, 85, 55, 65];\n\nfunction calculateAverage(currentArray) {\n  let total = 0;\n  for (let curValue of currentArray) {\n    total += curValue;\n  }\n  // console.log('total:', total);\n  return (total/currentArray.length);\n}\n\n// console.log(calculateAverage(MARKSARRAY));\n\nfunction calculateGrades(_currentArray) { \n  const average = calculateAverage(_currentArray);\n  // console.log('average:', average);\n\n  if(average \u003c 70) return grade = 'D'; \n  if(average \u003c 80) return grade = 'C';\n  if(average \u003c 90) return grade = 'B';\n  if(average \u003c= 100) return grade = 'A';\n}\n\nconsole.log('Grade:',calculateGrades(MARKSARRAY));\n\n```\n\nExample 12 Random Bingo Card\n=====================\n\n\u003cp\u003e\n  \u003cfigure\u003e\n    \u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cimg src=\"_images-javascript-exercise-beginners/12-random-bingo-card.png\" alt=\"Random Bingo Card\" title=\"Random Bingo Card\" width=\"1000\" border=\"2\" /\u003e\n    \u003cfigcaption\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp; Image 12 - Random Bingo Card\u003c/figcaption\u003e\n  \u003c/figure\u003e\n\u003c/p\u003e\n\n\u003e **Syntax \u0026 Example**: `12-random-bingo-card.html`\n```html\n\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n\u003chead\u003e\n  \u003cmeta charset=\"UTF-8\"\u003e\n  \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"\u003e\n  \u003ctitle\u003erandom-bingo-card\u003c/title\u003e\n  \u003clink rel=\"stylesheet\" type=\"text/css\" href=\"../style.css\" /\u003e\n\u003c/head\u003e\n\u003cbody\u003e \n  \n  \u003ch1\u003e12-random-bingo-card!\u003c/h1\u003e\n  \n  \u003ch3\u003eWrite a function to create a Bingo Card with Random numbers upto 75\u003c/h3\u003e\n  \u003ctable\u003e\n    \u003cthead\u003e\n      \u003ctr\u003e\n        \u003cth class=\"heading\"\u003eB\u003c/th\u003e\n        \u003cth class=\"heading\"\u003eI\u003c/th\u003e\n        \u003cth class=\"heading\"\u003eN\u003c/th\u003e\n        \u003cth class=\"heading\"\u003eG\u003c/th\u003e\n        \u003cth class=\"heading\"\u003eO\u003c/th\u003e\n      \u003c/tr\u003e\n    \u003c/thead\u003e\n\n    \u003ctbody\u003e\n      \u003ctr\u003e \n        \u003ctd id=\"Square1\"\u003e\u0026nbsp;\u003c/td\u003e\n        \u003ctd id=\"Square2\"\u003e\u0026nbsp;\u003c/td\u003e\n        \u003ctd id=\"Square3\"\u003e\u0026nbsp;\u003c/td\u003e\n        \u003ctd id=\"Square4\"\u003e\u0026nbsp;\u003c/td\u003e\n        \u003ctd id=\"Square5\"\u003e\u0026nbsp;\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n        \u003ctd id=\"Square6\"\u003e\u0026nbsp;\u003c/td\u003e\n        \u003ctd id=\"Square7\"\u003e\u0026nbsp;\u003c/td\u003e\n        \u003ctd id=\"Square8\"\u003e\u0026nbsp;\u003c/td\u003e\n        \u003ctd id=\"Square9\"\u003e\u0026nbsp;\u003c/td\u003e\n        \u003ctd id=\"Square10\"\u003e\u0026nbsp;\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n        \u003ctd id=\"Square11\"\u003e\u0026nbsp;\u003c/td\u003e\n        \u003ctd id=\"Square12\"\u003e\u0026nbsp;\u003c/td\u003e\n        \u003ctd id=\"freeSquare\"\u003eFree\u003c/td\u003e\n        \u003ctd id=\"Square13\"\u003e\u0026nbsp;\u003c/td\u003e\n        \u003ctd id=\"Square14\"\u003e\u0026nbsp;\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n        \u003ctd id=\"Square15\"\u003e\u0026nbsp;\u003c/td\u003e\n        \u003ctd id=\"Square16\"\u003e\u0026nbsp;\u003c/td\u003e\n        \u003ctd id=\"Square17\"\u003e\u0026nbsp;\u003c/td\u003e\n        \u003ctd id=\"Square18\"\u003e\u0026nbsp;\u003c/td\u003e\n        \u003ctd id=\"Square19\"\u003e\u0026nbsp;\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n        \u003ctd id=\"Square20\"\u003e\u0026nbsp;\u003c/td\u003e\n        \u003ctd id=\"Square21\"\u003e\u0026nbsp;\u003c/td\u003e\n        \u003ctd id=\"Square22\"\u003e\u0026nbsp;\u003c/td\u003e\n        \u003ctd id=\"Square23\"\u003e\u0026nbsp;\u003c/td\u003e\n        \u003ctd id=\"Square24\"\u003e\u0026nbsp;\u003c/td\u003e\n      \u003c/tr\u003e\n    \u003c/tbody\u003e\n  \u003c/table\u003e\n\n  \u003ch3\u003e\u003ca href=\"\"\u003eClick here\u003c/a\u003e (Reload/Refresh) to create Random Bingo Card!\u003c/h3\u003e\n\n  \u003cscript type=\"text/javascript\" src=\"script.js\"\u003e\u003c/script\u003e\n\n\u003c/body\u003e\n\u003c/html\u003e\n\n```\n\n\u003e **Syntax \u0026 Example**: `script.js`\n```js\n\nconsole.log('12-random-bingo-card');\n\nwindow.onload = createBingoCard;\n\nfunction createBingoCard() {\n  // console.log('in createBingoCard');\n\n  for (var i = 1; i \u003c= 24; i++) {\n    var newRandomNum = Math.floor(Math.random() * 75);\n    // console.log('newRandomNum', newRandomNum);\n    document.getElementById('Square' + i).innerHTML = newRandomNum;\n  }\n}\n\n```\n\nExample 13 Show Prime Numbers\n=====================\n\n\u003cp\u003e\n  \u003cfigure\u003e\n    \u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cimg src=\"_images-javascript-exercise-beginners/13-show-prime-numbers.png\" alt=\"Show Prime Numbers\" title=\"Show Prime Numbers\" width=\"1000\" border=\"2\" /\u003e\n    \u003cfigcaption\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp; Image 13 - Show Prime Numbers\u003c/figcaption\u003e\n  \u003c/figure\u003e\n\u003c/p\u003e\n\n\u003e **Syntax \u0026 Example**: `13-show-prime-numbers.html`\n```html\n\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n\u003chead\u003e\n  \u003cmeta charset=\"UTF-8\"\u003e\n  \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"\u003e\n  \u003ctitle\u003eshow-prime-numbers\u003c/title\u003e\n  \u003clink rel=\"stylesheet\" type=\"text/css\" href=\"../style.css\" /\u003e\n\u003c/head\u003e\n\u003cbody\u003e \n  \n  \u003ch1\u003e13-show-prime-numbers!\u003c/h1\u003e\n\n  \u003ch3\u003eWrite a function which show or print Prime Number upto provided range\u003c/h3\u003e\n\n  \u003cul\u003e\n    \u003cli\u003ePrime Numbers are those numbers whose factors are only `1` and `the number itself`\u003c/li\u003e\n    \u003cli\u003eIn simple language Prime Numbers are divisible by only `1` and `the number itself/himself`\u003c/li\u003e\n    \u003cli\u003ePrime Numbers have only two factors: `1` and `the number itself/himself`\u003c/li\u003e\n    \u003cli\u003eExample: 2, 3, 5, 7, 11, 13, 17, 19 and so on...\u003c/li\u003e\n  \u003c/ul\u003e\n\n  \u003cscript type=\"text/javascript\" src=\"script.js\"\u003e\u003c/script\u003e\n\n\u003c/body\u003e\n\u003c/html\u003e\n\n```\n\n\u003e **Syntax \u0026 Example**: `script.js`\n```js\n\nconsole.log('13-show-prime-numbers');\n\n// approach 1\n\n/* function showPrimeNumbers(numberLimit) {\n  for (let curNum = 2; curNum \u003c= numberLimit; curNum++) {\n    // console.log('curNum', curNum);\n\n    let isPrime = true;\n    for (let factor = 2; factor \u003c curNum; factor++) {\n      // console.log('factor', factor);\n      if (curNum % factor === 0) {\n        isPrime = false;\n        break;\n      }\n    }\n\n    if (isPrime) {\n      console.log('Prime Number', curNum);\n      \n    }\n  }\n} \n\nshowPrimeNumbers(20);*/\n\n// approach 2\n\nfunction showPrimeNumbers(numberLimit) {\n  for (let curNum = 2; curNum \u003c= numberLimit; curNum++) {\n    // console.log('curNum', curNum);\n    if (isPrimeNumber(curNum)) {\n      console.log('Prime Number:', curNum);\n    }\n  }\n}\n\nfunction isPrimeNumber(_number) {\n  for (let factor = 2; factor \u003c _number; factor++) {\n    // console.log('factor', factor);\n    if (_number % factor === 0) {\n      return false;\n    }\n  }\n  return true;\n}\n\nshowPrimeNumbers(20);\n\n```\n\nExample 14 Sum Of Arguments\n=====================\n\n\u003cp\u003e\n  \u003cfigure\u003e\n    \u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cimg src=\"_images-javascript-exercise-beginners/14-sum-of-arguments.png\" alt=\"Sum Of Arguments\" title=\"Sum Of Arguments\" width=\"1000\" border=\"2\" /\u003e\n    \u003cfigcaption\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp; Image 14 - Sum Of Arguments\u003c/figcaption\u003e\n  \u003c/figure\u003e\n\u003c/p\u003e\n\n\u003e **Syntax \u0026 Example**: `14-sum-of-arguments.html`\n```html\n\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n\u003chead\u003e\n  \u003cmeta charset=\"UTF-8\"\u003e\n  \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"\u003e\n  \u003ctitle\u003esum-of-arguments\u003c/title\u003e\n  \u003clink rel=\"stylesheet\" type=\"text/css\" href=\"../style.css\" /\u003e\n\u003c/head\u003e\n\u003cbody\u003e \n  \n  \u003ch1\u003e14-sum-of-arguments!\u003c/h1\u003e\n\n  \u003ch3\u003eWrite a function which show or print Sum of Arguments passed\u003c/h3\u003e\n\n  \u003cscript type=\"text/javascript\" src=\"script.js\"\u003e\u003c/script\u003e\n\n\u003c/body\u003e\n\u003c/html\u003e\n\n```\n\n\u003e **Syntax \u0026 Example**: `script.js`\n```js\n\nconsole.log('14-sum-of-arguments');\n\nfunction sumOfArguments(...items){\n  // rest operator converts anything passed as an array\n  console.log('current items/values to add:', items);\n  return items.reduce((n1, n2) =\u003e n1 +n2);\n}\n\nconsole.log('Sum:', sumOfArguments(10, 2, 8, 4, 6));\n// console.log('Sum:', sumOfArguments([10, 2, 8, 4, 6]));\n\n```\n\nExample 15 Sum Of Arguments Array\n=====================\n\n\u003cp\u003e\n  \u003cfigure\u003e\n    \u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cimg src=\"_images-javascript-exercise-beginners/15-sum-of-arguments-array.png\" alt=\"Sum Of Arguments Array\" title=\"Sum Of Arguments Array\" width=\"1000\" border=\"2\" /\u003e\n    \u003cfigcaption\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp; Image 15 - Sum Of Arguments Array\u003c/figcaption\u003e\n  \u003c/figure\u003e\n\u003c/p\u003e\n\n\u003e **Syntax \u0026 Example**: `15-sum-of-arguments-array.html`\n```html\n\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n\u003chead\u003e\n  \u003cmeta charset=\"UTF-8\"\u003e\n  \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"\u003e\n  \u003ctitle\u003esum-of-arguments-array\u003c/title\u003e\n  \u003clink rel=\"stylesheet\" type=\"text/css\" href=\"../style.css\" /\u003e\n\u003c/head\u003e\n\u003cbody\u003e \n  \n  \u003ch1\u003e15-sum-of-arguments-array!\u003c/h1\u003e\n\n  \u003ch3\u003eWrite a function which show or print Sum of Arguments passed as an Array\u003c/h3\u003e\n\n  \u003cscript type=\"text/javascript\" src=\"script.js\"\u003e\u003c/script\u003e\n\n\u003c/body\u003e\n\u003c/html\u003e\n\n```\n\n\u003e **Syntax \u0026 Example**: `script.js`\n```js\n\nconsole.log('15-sum-of-arguments-array');\n\nfunction sumOfArguments(...items){\n  // as rest operator converts anything passed as an array check following\n  if(items.length === 1 \u0026\u0026 Array.isArray(items[0])) {\n    // reset item as a new array \n    items = [...items[0]]\n    console.log('current items/values to add:', items);\n    return items.reduce((n1, n2) =\u003e n1 +n2);\n  }\n}\n\n// pass arguments as an array\n// console.log('Sum:', sumOfArguments([10, 2, 8, 4, 6]));\nconsole.log('Sum:', sumOfArguments([10, 2, 8, 4, 6]));\n\n```\n\nExample 16 Circle Area Object Read Only Property\n=====================\n\n\u003cp\u003e\n  \u003cfigure\u003e\n    \u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cimg src=\"_images-javascript-exercise-beginners/16-circle-area-object-read-only-property.png\" alt=\"Circle Area Object Read Only Property\" title=\"Circle Area Object Read Only Property\" width=\"1000\" border=\"2\" /\u003e\n    \u003cfigcaption\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp; Image 16 - Circle Area Object Read Only Property\u003c/figcaption\u003e\n  \u003c/figure\u003e\n\u003c/p\u003e\n\n\u003e **Syntax \u0026 Example**: `16-circle-area-object-read-only-property.html`\n```html\n\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n\u003chead\u003e\n  \u003cmeta charset=\"UTF-8\"\u003e\n  \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"\u003e\n  \u003ctitle\u003ecircle-area-object-read-only-property\u003c/title\u003e\n  \u003clink rel=\"stylesheet\" type=\"text/css\" href=\"../style.css\" /\u003e\n\u003c/head\u003e\n\u003cbody\u003e \n  \n  \u003ch1\u003e16-circle-area-object-read-only-property!\u003c/h1\u003e\n\n  \u003ch3\u003eCreate an object with read only propety named 'area'\u003c/h3\u003e\n\n  \u003cscript type=\"text/javascript\" src=\"script.js\"\u003e\u003c/script\u003e\n\n\u003c/body\u003e\n\u003c/html\u003e\n\n```\n\n\u003e **Syntax \u0026 Example**: `script.js`\n```js\n\nconsole.log('16-circle-area-object-read-only-property');\n\nconst CIRCLE = {\n  name: 'mainCircle',\n  lineColor: 'red',\n  bgColor: 'gray',\n  radius: 1,\n  get area() {\n    return Math.PI * this.radius * this.radius;\n  }\n}\n\nconsole.log('CIRCLE.area:', CIRCLE.area);\n\n```\n\nExample 17 Create Array From Argument Range\n=====================\n\n\u003cp\u003e\n  \u003cfigure\u003e\n    \u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cimg src=\"_images-javascript-exercise-beginners/17-create-array-from-argument-range.png\" alt=\"Create Array From Argument Range\" title=\"Create Array From Argument Range\" width=\"1000\" border=\"2\" /\u003e\n    \u003cfigcaption\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp; Image 17 - Create Array From Argument Range\u003c/figcaption\u003e\n  \u003c/figure\u003e\n\u003c/p\u003e\n\n\u003e **Syntax \u0026 Example**: `17-create-array-from-argument-range.html`\n```html\n\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n\u003chead\u003e\n  \u003cmeta charset=\"UTF-8\"\u003e\n  \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"\u003e\n  \u003ctitle\u003ecreate-array-from-argument-range\u003c/title\u003e\n  \u003clink rel=\"stylesheet\" type=\"text/css\" href=\"../style.css\" /\u003e\n\u003c/head\u003e\n\u003cbody\u003e \n  \n  \u003ch1\u003e17-create-array-from-argument-range!\u003c/h1\u003e\n\n  \u003ch3\u003eCreate an array of the values from the 'min' and 'max' (start \u0026 end) range provided\u003c/h3\u003e\n\n  \u003cscript type=\"text/javascript\" src=\"script.js\"\u003e\u003c/script\u003e\n\n\u003c/body\u003e\n\u003c/html\u003e\n\n```\n\n\u003e **Syntax \u0026 Example**: `script.js`\n```js\n\nconsole.log('17-create-array-from-argument-range');\n\nfunction generateArrayFromRange(startNum, endNum) {\n  const rangeArray = [];\n  for(let curNum = startNum; curNum \u003c= endNum; curNum++) {\n    // console.log('curNum: ', curNum);\n    rangeArray.push(curNum);\n    // console.log('rangeArray: ', rangeArray);\n  }\n  return rangeArray;\n}\n\nconst range1 = generateArrayFromRange(1, 5);\nconsole.log(range1);\nconsole.log('----------');\nconst range2 = generateArrayFromRange(-5, 0);\nconsole.log(range2);\n\n```\n\nExample 18 Array Includes Element Exists\n=====================\n\n\u003cp\u003e\n  \u003cfigure\u003e\n    \u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cimg src=\"_images-javascript-exercise-beginners/18-array-includes-element-exists.png\" alt=\"Array Includes Element Exists\" title=\"Array Includes Element Exists\" width=\"1000\" border=\"2\" /\u003e\n    \u003cfigcaption\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp; Image 18 - Array Includes Element Exists\u003c/figcaption\u003e\n  \u003c/figure\u003e\n\u003c/p\u003e\n\n\u003e **Syntax \u0026 Example**: `18-array-includes-element-exists.html`\n```html\n\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n\u003chead\u003e\n  \u003cmeta charset=\"UTF-8\"\u003e\n  \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"\u003e\n  \u003ctitle\u003earray-includes-element-exists\u003c/title\u003e\n  \u003clink rel=\"stylesheet\" type=\"text/css\" href=\"../style.css\" /\u003e\n\u003c/head\u003e\n\u003cbody\u003e \n  \n  \u003ch1\u003e18-array-includes-element-exists!\u003c/h1\u003e\n\n  \u003ch3\u003eCreate a method named 'includes' which checks an element exists in an array\u003c/h3\u003e\n\n  \u003cscript type=\"text/javascript\" src=\"script.js\"\u003e\u003c/script\u003e\n\n\u003c/body\u003e\n\u003c/html\u003e\n\n```\n\n\u003e **Syntax \u0026 Example**: `script.js`\n```js\n\nconsole.log('18-array-includes-element-exists');\n\nfunction includes(arrayToSearch, elementToSearch) {\n  console.log('arrayToSearch: ', arrayToSearch);\n  console.log('elementToSearch: ', elementToSearch);\n  for(let curElement of arrayToSearch) {\n    if(curElement === elementToSearch) {\n      return true;\n    } \n  }\n  return false;\n}\n\nconst versionArray = [1, 2, 5, 7, 2];\nconsole.log(includes(versionArray, 2));\nconsole.log('---------');\nconst ageArray = [21, 22, 25, 27, 25];\nconsole.log(includes(ageArray, 30));\n\n```\n\nExample 19 Array Excludes Value To New Array\n=====================\n\n\u003cp\u003e\n  \u003cfigure\u003e\n    \u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cimg src=\"_images-javascript-exercise-beginners/19-array-excludes-value-to-new-array.png\" alt=\"Array Excludes Value To New Array\" title=\"Array Excludes Value To New Array\" width=\"1000\" border=\"2\" /\u003e\n    \u003cfigcaption\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp; Image 19 - Array Excludes Value To New Array\u003c/figcaption\u003e\n  \u003c/figure\u003e\n\u003c/p\u003e\n\n\u003e **Syntax \u0026 Example**: `19-array-excludes-value-to-new-array.html`\n```html\n\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n\u003chead\u003e\n  \u003cmeta charset=\"UTF-8\"\u003e\n  \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"\u003e\n  \u003ctitle\u003earray-excludes-value-to-new-array\u003c/title\u003e\n  \u003clink rel=\"stylesheet\" type=\"text/css\" href=\"../style.css\" /\u003e\n\u003c/head\u003e\n\u003cbody\u003e \n  \n  \u003ch1\u003e19-array-excludes-value-to-new-array!\u003c/h1\u003e\n\n  \u003ch3\u003eCreate a method named 'excludes' which cut/excludes values from existing array and push to new array\u003c/h3\u003e\n\n  \u003cscript type=\"text/javascript\" src=\"script.js\"\u003e\u003c/script\u003e\n\n\u003c/body\u003e\n\u003c/html\u003e\n\n```\n\n\u003e **Syntax \u0026 Example**: `script.js`\n```js\n\nconsole.log('19-array-excludes-value-to-new-array');\n\nfunction excludes(arrayToExclude, elementsToExcluded) {\n  console.log('arrayToExclude: ', arrayToExclude);\n  console.log('elementsToExcluded: ', elementsToExcluded);\n  const outputArray = [];\n  for(let curElement of arrayToExclude) {\n    if(!elementsToExcluded.includes(curElement)) {\n      outputArray.push(curElement)\n    }\n  }\n  return outputArray;\n}\n\nconst versionArray = [1, 2, 5, 7, 2];\nconst newVesionArray = (excludes(versionArray, [2]));\nconsole.log('newVesionArray: ', newVesionArray);\n\nconsole.log('---------');\n\nconst ageArray = [21, 25, 22, 25, 30, 25, 30];\nconst newAgeArray = (excludes(ageArray, [25,30]));\nconsole.log('newAgeArray: ', newAgeArray);\n\n```\n\nExample 20 Array Count Search Occurances\n=====================\n\n\u003cp\u003e\n  \u003cfigure\u003e\n    \u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cimg src=\"_images-javascript-exercise-beginners/20-01-array-count-search-occurances.png\" alt=\"Array Count Search Occurances\" title=\"Array Count Search Occurances\" width=\"1000\" border=\"2\" /\u003e\n    \u003cfigcaption\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp; Image 20-01 - Array Count Search Occurances\u003c/figcaption\u003e\n  \u003c/figure\u003e\n\u003c/p\u003e\n\n\u003e **Syntax \u0026 Example**: `array-count-search-occurances.html`\n```html\n\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n\u003chead\u003e\n  \u003cmeta charset=\"UTF-8\"\u003e\n  \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"\u003e\n  \u003ctitle\u003earray-count-search-occurances\u003c/title\u003e\n  \u003clink rel=\"stylesheet\" type=\"text/css\" href=\"../style.css\" /\u003e\n\u003c/head\u003e\n\u003cbody\u003e \n  \n  \u003ch1\u003e20-array-count-search-occurances!\u003c/h1\u003e\n\n  \u003ch3\u003eCreate a function which counts the search occurances from an array\u003c/h3\u003e\n\n  \u003cscript type=\"text/javascript\" src=\"script.js\"\u003e\u003c/script\u003e\n\n\u003c/body\u003e\n\u003c/html\u003e\n\n```\n\n\u003e **Syntax \u0026 Example**: `script.js`\n```js\n\nconsole.log('20-array-count-search-occurances');\n\n// approach 1\n/* function countSearchOccurances(arrayToSearch, elementsToSearch) {\n  // console.log('arrayToSearch: ', arrayToSearch);\n  // console.log('elementsToSearch: ', elementsToSearch);\n  let count = 0;\n  for(let curElement of arrayToSearch) {\n    if(curElement === elementsToSearch) {\n      count++;\n    }\n  }\n  // console.log('search count:', count);\n  return count;\n} */\n\n// approach 2 \nfunction countSearchOccurances(arrayToSearch, elementsToSearch) {\n\n  return arrayToSearch.reduce((countAccumulator, curentSearchElement) =\u003e {\n    let countOccurances = (curentSearchElement === elementsToSearch) ? 1 : 0;\n    // console.log('countAccumulator', countAccumulator, 'arrayToSearch', arrayToSearch, 'elementsToSearch', elementsToSearch,);\n    return countAccumulator + countOccurances;\n  },0)\n}\n\nconst versionArray = [1, 2, 5, 7, 2];\nconst versionCount = (countSearchOccurances(versionArray, 2));\nconsole.log('versionCount: ', versionCount);\n\nconsole.log('---------');\n\nconst ageArray = [21, 25, 22, 25, 30, 25, 30];\nconst ageCount = (countSearchOccurances(ageArray, -25));\nconsole.log('ageCount: ', ageCount);\n\n```\n\n\u003cp\u003e\n  \u003cfigure\u003e\n    \u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cimg src=\"_images-javascript-exercise-beginners/20-02-array-count-search-occurances.png\" alt=\"Array Count Search Occurances\" title=\"Array Count Search Occurances\" width=\"1000\" border=\"2\" /\u003e\n    \u003cfigcaption\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp; Image 20-02 - Array Count Search Occurances\u003c/figcaption\u003e\n  \u003c/figure\u003e\n\u003c/p\u003e\n\nExample 21 - Array Get Max Largest Number\n=====================\n\n\u003cp\u003e\n  \u003cfigure\u003e\n    \u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cimg src=\"_images-javascript-exercise-beginners/21-array-get-max-largest-number.png\" alt=\"Array Get Max Largest Number\" title=\"Array Get Max Largest Number\" width=\"1000\" border=\"2\" /\u003e\n    \u003cfigcaption\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp; Image 21 - Array Get Max Largest Number\u003c/figcaption\u003e\n  \u003c/figure\u003e\n\u003c/p\u003e\n\n\u003e **Syntax \u0026 Example**: `21-array-get-max-largest-number.html`\n```html\n\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n\n\u003chead\u003e\n  \u003cmeta charset=\"UTF-8\"\u003e\n  \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"\u003e\n  \u003ctitle\u003earray-get-max-largest-number\u003c/title\u003e\n  \u003clink rel=\"stylesheet\" type=\"text/css\" href=\"../style.css\" /\u003e\n\u003c/head\u003e\n\n\u003cbody\u003e\n\n  \u003ch1\u003e21-array-get-max-largest-number!\u003c/h1\u003e\n\n  \u003ch3\u003eCreate a function which returns the maximum ie. largest number from an array\u003c/h3\u003e\n\n  \u003cscript type=\"text/javascript\" src=\"script.js\"\u003e\u003c/script\u003e\n\n\u003c/body\u003e\n\n\u003c/html\u003e\n\n```\n\n\u003e **Syntax \u0026 Example**: `script.js`\n```js\n\nconsole.log('21-array-get-max-largest-number');\n\n// approach 1\n/* \nfunction getLargestNumber(arrayToSearch) {\n  if (arrayToSearch.length \u003c= 0) return 'Array is Empty! Nothing to search!!';\n  let largetNumber = arrayToSearch[0];\n\n  for (let i = 1; i \u003c arrayToSearch.length; i++) {\n    if (arrayToSearch[i] \u003e largetNumber) {\n      largetNumber = arrayToSearch[i];\n    }\n  }\n  return largetNumber;\n} \n\nconst versionArray = [5, 2, 3, 4, 7];\nconst largestVersion = (getLargestNumber(versionArray));\nconsole.log('largestVersion: ', largestVersion);\n\nconsole.log('---------');\n\nconst ageArray = [21, 25, 22, 25, 30, 25, 30];\nconst maxAge = (getLargestNumber(ageArray));\nconsole.log('maxAge: ', maxAge); */\n\n// approach 2 \n\nfunction getLargestNumber(arrayToSearch) {\n  if (arrayToSearch.length \u003c= 0) return 'Array is Empty! Nothing to search!!';\n\n  return arrayToSearch.reduce((largetNumber, curentSearchElement) =\u003e {\n    return (curentSearchElement \u003e largetNumber) ? curentSearchElement : largetNumber;\n  })\n}\n\nconst versionArray = [5, 2, 3, 4, 7];\nconst largestVersion = (getLargestNumber(versionArray));\nconsole.log('largestVersion: ', largestVersion);\n\nconsole.log('---------');\n\nconst ageArray = [21, 25, 22, 25, 30, 25, 30];\nconst maxAge = (getLargestNumber(ageArray));\nconsole.log('maxAge: ', maxAge);\n\n```\n\nExample 22 Array Filter Sort Map\n=====================\n\n\u003cp\u003e\n  \u003cfigure\u003e\n    \u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cimg src=\"_images-javascript-exercise-beginners/22-array-filter-sort-map.png\" alt=\"Array Filter Sort Map\" title=\"Array Filter Sort Map\" width=\"1000\" border=\"2\" /\u003e\n    \u003cfigcaption\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp; Image 22 - Array Filter Sort Map\u003c/figcaption\u003e\n  \u003c/figure\u003e\n\u003c/p\u003e\n\n\u003e **Syntax \u0026 Example**: `22-array-filter-sort-map.html`\n```html\n\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n\n\u003chead\u003e\n  \u003cmeta charset=\"UTF-8\"\u003e\n  \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"\u003e\n  \u003ctitle\u003earray-filter-sort-map\u003c/title\u003e\n  \u003clink rel=\"stylesheet\" type=\"text/css\" href=\"../style.css\" /\u003e\n\u003c/head\u003e\n\n\u003cbody\u003e\n\n  \u003ch1\u003e22-array-filter-sort-map!\u003c/h1\u003e\n\n  \u003ch3\u003eArray: Filter the array of students with Higest Ranking, Sort on Ranking, finally Show the Names \u003c/h3\u003e\n\n  \u003cscript type=\"text/javascript\" src=\"script.js\"\u003e\u003c/script\u003e\n\n\u003c/body\u003e\n\n\u003c/html\u003e\n\n```\n\n\u003e **Syntax \u0026 Example**: `script.js`\n```js\n\nconsole.log('22-array-filter-sort-map');\n\nconst studentsArray = [\n  { name: 'Suraj', year: 2019, ranking: 4 },\n  { name: 'Amit', year: 2019, ranking: 5 },\n  { name: 'Akash', year: 2018, ranking: 4 },\n  { name: 'Dinanath', year: 2019, ranking: 7 },\n  { name: 'Sagar', year: 2017, ranking: 3 },\n]\n\nconsole.log('Higest Rank Holders:',\n  studentsArray\n    .filter(student =\u003e student.year === 2019 \u0026\u0026 student.ranking \u003e= 5)\n    .sort((n1, n2) =\u003e n1.ranking - n2.ranking)\n    .reverse()\n    .map(student =\u003e student.name)\n);\n\n```\n\nExample 23 Object Create Students and Address Object\n=====================\n\n\u003cp\u003e\n  \u003cfigure\u003e\n    \u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cimg src=\"_images-javascript-exercise-beginners/23-object-create-students-and-address-object.png\" alt=\"Object Create Students and Address Object\" title=\"Object Create Students and Address Object\" width=\"1000\" border=\"2\" /\u003e\n    \u003cfigcaption\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp; Image 23 - Object Create Students and Address Object\u003c/figcaption\u003e\n  \u003c/figure\u003e\n\u003c/p\u003e\n\n\u003e **Syntax \u0026 Example**: `23-object-create-students-and-address-object.html`\n```html\n\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n\n\u003chead\u003e\n  \u003cmeta charset=\"UTF-8\"\u003e\n  \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"\u003e\n  \u003ctitle\u003eobject-create-students-and-address-object\u003c/title\u003e\n  \u003clink rel=\"stylesheet\" type=\"text/css\" href=\"../style.css\" /\u003e\n\u003c/head\u003e\n\n\u003cbody\u003e\n\n  \u003ch1\u003e23-object-create-students-and-address-object!\u003c/h1\u003e\n\n  \u003ch3\u003eCreate an Object for Students and Address with various Properties and Methods \u003c/h3\u003e\n\n  \u003cscript type=\"text/javascript\" src=\"script.js\"\u003e\u003c/script\u003e\n\n\u003c/body\u003e\n\n\u003c/html\u003e\n\n```\n\n\u003e **Syntax \u0026 Example**: `script.js`\n```js\n\nconsole.log('23-object-create-students-and-address-object');\n\nconst Students = {\n  name: 'Dinanath',\n  age: 35,\n  rank: 5,\n  country: 'India',\n}\n\nconst Address = {\n  street: 'Sir DJ Road',\n  city: 'Mumbai',\n  pinCode: 401209,\n  state: 'MH',\n  country: 'India',\n}\n\nfunction showObjectDetails(obj) {\n  for(let key in obj) {\n    console.log(key,' : ',obj[key]);\n  }\n}\n\nshowObjectDetails(Students);\nconsole.log('----------');\nshowObjectDetails(Address);\n\n```\n\nExample 24 Object Create Object Factory Constructor Function\n=====================\n\n\u003cp\u003e\n  \u003cfigure\u003e\n    \u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cimg src=\"_images-javascript-exercise-beginners/24-object-create-object-factory-constructor-function.png\" alt=\"Object Create Object Factory Constructor Function\" title=\"Object Create Object Factory Constructor Function\" width=\"1000\" border=\"2\" /\u003e\n    \u003cfigcaption\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp; Image 24 - Object Create Object Factory Constructor Function\u003c/figcaption\u003e\n  \u003c/figure\u003e\n\u003c/p\u003e\n\n\u003e **Syntax \u0026 Example**: `24-object-create-object-factory-constructor-function.html`\n```html\n\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n\n\u003chead\u003e\n  \u003cmeta charset=\"UTF-8\"\u003e\n  \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"\u003e\n  \u003ctitle\u003eobject-create-object-factory-constructor-function\u003c/title\u003e\n  \u003clink rel=\"stylesheet\" type=\"text/css\" href=\"../style.css\" /\u003e\n\u003c/head\u003e\n\n\u003cbody\u003e\n\n  \u003ch1\u003e24-object-create-object-factory-constructor-function!\u003c/h1\u003e\n\n  \u003ch3\u003eCreate an Object of Students by using Factory and Constructor methods\u003c/h3\u003e\n\n  \u003cscript type=\"text/javascript\" src=\"script.js\"\u003e\u003c/script\u003e\n\n\u003c/body\u003e\n\n\u003c/html\u003e\n\n```\n\n\u003e **Syntax \u0026 Example**: `script.js`\n```js\n\nconsole.log('24-object-create-object-factory-constructor-function');\n\n// Factory function/method - camelCasing - camel notation - use return keyword\nfunction createObjFactoryMethod(name, age, rank, country) {\n  return {\n    name, age, rank, country\n  }\n}\n\nlet Students1 = createObjFactoryMethod('Dinanath', 35, 5, 'India');\nconsole.log('Students1', Students1);\n\n// Constructor function/method - pascalCasing - pascal notation - use this keyword\nfunction Student(name, age, rank, country) {\n  this.name = name;\n  this.age = age;\n  this.rank = rank;\n  this.country = country;\n}\n\nlet Students2 = new Student('Amit', 30, 4, 'Hindustan');\nconsole.log('Students2', Students2);\n\n```\n\nExample 25 Object Equality\n=====================\n\n\u003cp\u003e\n  \u003cfigure\u003e\n    \u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cimg src=\"_images-javascript-exercise-beginners/25-object-equality.png\" alt=\"Object Equality\" title=\"Object Equality\" width=\"1000\" border=\"2\" /\u003e\n    \u003cfigcaption\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp; Image 25 - Object Equality\u003c/figcaption\u003e\n  \u003c/figure\u003e\n\u003c/p\u003e\n\n\u003e **Syntax \u0026 Example**: `25-object-equality.html`\n```html\n\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n\n\u003chead\u003e\n  \u003cmeta charset=\"UTF-8\"\u003e\n  \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"\u003e\n  \u003ctitle\u003eobject-equality\u003c/title\u003e\n  \u003clink rel=\"stylesheet\" type=\"text/css\" href=\"../style.css\" /\u003e\n\u003c/head\u003e\n\n\u003cbody\u003e\n\n  \u003ch1\u003e25-object-equality!\u003c/h1\u003e\n\n  \u003ch3\u003eWrite function to check object equality\u003c/h3\u003e\n\n  \u003cscript type=\"text/javascript\" src=\"script.js\"\u003e\u003c/script\u003e\n\n\u003c/body\u003e\n\n\u003c/html\u003e\n\n```\n\n\u003e **Syntax \u0026 Example**: `script.js`\n```js\n\nconsole.log('25-object-equality');\n\n// Constructor function/method - pascalCasing - pascal notation - use this keyword\nfunction Student(name, age, rank, country) {\n  this.name = name;\n  this.age = age;\n  this.rank = rank;\n  this.country = country;\n}\n\nlet Students1 = new Student('Dinanath', 35, 5, 'India');\nconsole.log('Students1', Students1);\n\nlet Students2 = new Student('Dinanath', 35, 5, 'India');\nconsole.log('Students2', Students2);\n\nconsole.log('----------');\n\n// Objects are reference type, objects can have same properties but they are from different memeory location, they can be equal if both objects have same properties\nfunction isObjectEqual(obj1, obj2){\n  return obj1.name === obj2.name \u0026\u0026\n         obj1.age === obj2.age \u0026\u0026\n         obj1.rank === obj2.rank \u0026\u0026\n         obj1.country === obj2.country\n}\n\nconsole.log('isEqual', isObjectEqual(Students1, Students2));\n\nconsole.log('----------');\n\n// Objects are same if both are pointed to same object\nfunction isObjectPointSame(obj1, obj2){\n  return obj1 === obj2;\n}\n\nlet isSame1 = isObjectPointSame(Students1, Students2);\nconsole.log('isSame1', isSame1);\n\nlet Students3 = Students2;\nlet isSame2 = isObjectPointSame(Students2, Students3);\nconsole.log('isSame2', isSame2);\n\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdinanathsj29%2Fjavascript-exercise-beginners","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdinanathsj29%2Fjavascript-exercise-beginners","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdinanathsj29%2Fjavascript-exercise-beginners/lists"}