{"id":21023421,"url":"https://github.com/adrinlol/linkedin-javascript-assessment","last_synced_at":"2025-12-25T19:56:29.050Z","repository":{"id":48699386,"uuid":"197735260","full_name":"Adrinlol/linkedin-javascript-assessment","owner":"Adrinlol","description":"LinkedIn JavaScript Assessment Answers - 2019-2021","archived":false,"fork":false,"pushed_at":"2021-11-10T21:27:43.000Z","size":39,"stargazers_count":109,"open_issues_count":0,"forks_count":31,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-01-20T13:35:05.458Z","etag":null,"topics":["assessment-test","javascript-answers","javascript-questions","javascript-quiz","javascript-test","javascript-tests","linkedin-assessment","linkedin-test"],"latest_commit_sha":null,"homepage":"","language":null,"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/Adrinlol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"patreon":"adrinlol","custom":"https://www.buymeacoffee.com/adrinlol"}},"created_at":"2019-07-19T08:35:07.000Z","updated_at":"2024-08-26T05:12:21.000Z","dependencies_parsed_at":"2022-09-23T03:33:03.178Z","dependency_job_id":null,"html_url":"https://github.com/Adrinlol/linkedin-javascript-assessment","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Adrinlol%2Flinkedin-javascript-assessment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Adrinlol%2Flinkedin-javascript-assessment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Adrinlol%2Flinkedin-javascript-assessment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Adrinlol%2Flinkedin-javascript-assessment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Adrinlol","download_url":"https://codeload.github.com/Adrinlol/linkedin-javascript-assessment/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243456569,"owners_count":20293905,"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":["assessment-test","javascript-answers","javascript-questions","javascript-quiz","javascript-test","javascript-tests","linkedin-assessment","linkedin-test"],"created_at":"2024-11-19T11:18:06.266Z","updated_at":"2025-12-25T19:56:29.002Z","avatar_url":"https://github.com/Adrinlol.png","language":null,"funding_links":["https://patreon.com/adrinlol","https://www.buymeacoffee.com/adrinlol"],"categories":[],"sub_categories":[],"readme":"## LinkedIn JavaScript Assessment\nLinkedIn Assessments - JavaScript 2019-2021\n\n\n## Overview\n #### Answer 15-20 timed, multiple-choice questions\n\n- ~15 minutes duration\n- 70th percentile required to pass and get a badge\n- Retry in 3 months if you don’t pass\n\n----------------------------------------------------------\n\n#### Q1. You've written the  event listener shown below for a form button, but  each time you click the button, the page reloads. Which statement would stop this from happening?\n```javascript\nbutton.addEventListener('click', function(e) {\n  button.className = 'clicked';\n}, false);\n```\n\n- e.preventDefault();\n\n----------------------------------------------------------\n\n#### Q2. Which statement references the DOM node created by the code shown?\n\n```\n \u003cp class=\"pull\"\u003eLorem Ipsum \u003c/p\u003e\n```\n\n- document.querySelector(\".pull\");\n\n----------------------------------------------------------\n\n#### Q3. Which statement is the correct way to create a variable called rate and assign it the value 100?\n\n```javascript\nlet rate = 100;\n```\n\n----------------------------------------------------------\n\n#### Q4. When would the final statement in the code shown be logged to the console?\n```javascript\nlet modal = document.querySelector('#results');\nsetTimeout(function() {\n  modal.classList.remove('hidden');\n}, 10000);\nconsole.log('Results shown');\n```\n\n- Immediately\n\n----------------------------------------------------------\n\n#### Q5. Which statement creates a new object using the Person constructor?\n\n-  var student = new Person();\n\n----------------------------------------------------------\n\n#### Q6. When would you use a conditional statement?\n\n- When you want your code to choose between multiple options.\n\n----------------------------------------------------------\n\n#### Q7. How is forEach statement different from a for statement?\n\n- A for statement is generic but a forEach statement can be used only with an array.\n\n----------------------------------------------------------\n\n#### Q8. Review the code below. Which statement calls the addTax function and passes 50 as the argument?\n\n```javascript\naddTax(50);\n```\n\n----------------------------------------------------------\n\n#### Q9. What is the result in the console of running the code shown?\n```javascript\nvar Storm = function () {};\nStorm.prototype.precip = 'rain';\nvar WinterStorm = function () {};\nWinterStorm.prototype = new Storm();\nWinterStorm.prototype.precip = 'snow';\nvar bob = new WinterStorm();\n\nconsole.log(bob.precip);\n\n```\n\n- 'snow'\n\n----------------------------------------------------------\n\n#### Q10. How does a function create a closure?\n\n- It returns a reference to a variable in its parent scope.\n\n----------------------------------------------------------\n\n#### Q11. What is the result in the console of running this code?\n```javascript\n\"use strict\";\nfunction logThis() {\n  this.desc=\"logger\";\n  console.log(this);\n}\n\nnew logThis();\n```\n\n- logThis { desc: 'logger' }\n\n----------------------------------------------------------\n\n#### Q12. What is the result of running this statement?\n```javascript\nconsole.log(typeof(42));\n```\n\n- 'Number'\n\n----------------------------------------------------------\n\n#### Q13. Which operator returns true if the two compared values are not equal?\n \n- !== \n\n----------------------------------------------------------\n\n#### Q14. Which statement is the correct way to create a variable called rate and assign it the value 100?\n\n```javascript\nlet rate = 100;\n```\n\n----------------------------------------------------------\n\n#### Q15. Which statement creates a new object using the Person constructor?\n\n```javascript\nvar student = new Person();\n```\n\n----------------------------------------------------------\n\n#### Q16. How would you reference the text 'avenue' in the code shown?\n\n```javascript\nroadTypes[2]\n```\n\n----------------------------------------------------------\n\n#### Q17. Which property references the DOM object that dispatched an event?\n\n- target\n\n----------------------------------------------------------\n\n#### Q18. Which method converts JSON data to a JavaScript object?\n\n```javascript\nJSON.parse()\n```\n\n----------------------------------------------------------\n\n#### Q19. When would you use a conditional statement?\n\n- When you want your code to choose between multiple options\n\n----------------------------------------------------------\n\n#### Q20. What would be the result in the console of running this code?\n\n```javascript\nfor(var i=0; i\u003c5; i++){ \n  console.log(i); \n}\n\n```\n\n- 01234 \n\n----------------------------------------------------------\n\n#### Q21. What is the name of a function whose execution can be suspended and resumed at a later point?\n\n- Generator\n\n----------------------------------------------------------\n\n#### Q22. You've written the code shown to log a set of consecutive values, but it instead results in the value 5, 5, 5, and 5 being logged to the console. Which revised version of the code would result in the value 1, 2, 3 and 4 being logged?\n\n```javascript\nfor (var i=1; i\u003c=4; i++){\n   setTimeout(function(){\n       console.log(i);\n   }, i*10000);\n  }\n\n```\n\n- ```for (var i = 1; i \u003c= 4; i++) {{function(j) {setTimeout(function() {console.log(j);}, j * 1000);})(i)};```\n\n----------------------------------------------------------\n\n#### Q23. Which statement creates a new function called discountPrice?\n\n- ```let discountPrice = function(price) { return price * 0.85; };```\n\n----------------------------------------------------------\n\n#### Q24. You need to match a time value such as 12:00:32. Which of the following regular expressions would work for your code?\n\n- /\\d\\d:\\d\\d:\\d\\d/\n\n----------------------------------------------------------\n\n#### Q25. How many prototype objects are in the chain for the following array?\n\n```javascript\nlet arr = [];\n\n```\n- 2\n\n----------------------------------------------------------\n\n#### Q26. Which of the following is not a unary operator?\n\n- instanceof \n\n----------------------------------------------------------\n\n#### Q27. What type of scope does the end variable have in the code shown?\n\n```javascript\nvar start = 1;\nif (start === 1) {\n  let end = 2;\n}\n\n```\n- block \n\n----------------------------------------------------------\n\n#### Q28. What will the value of y be in this code:\n\n```javascript\nconst x = 6 % 2;\nconst y = x ? 'One': 'Two';\n\n```\n- Two \n\n----------------------------------------------------------\n\n#### Q29. Which keyword is used to create an error?\n\n- throw\n\n----------------------------------------------------------\n\n#### Q30. What's one difference between the async and defer attributes of the HTML script tag?\n\n- The defer attribute will asynchronously load the scripts in order\n\n----------------------------------------------------------\n\n#### Q31. The following program has a problem. What is it?\n\n```javascript\nvar a;\nvar b = (a = 3) ? true: false\n\n```\n- The condition in the ternary is using the assignment operator. \n\n----------------------------------------------------------\n\n#### Q32. Which statement references the DOM node created by the code shown?\n\n```javascript\n\u003cp class=\"pull\"\u003elorem ipsum\u003c/p\u003e\n\n```\n- ```document.querySelector('.pull');```\n\n----------------------------------------------------------\n\n#### Q33. What value does the code return?\n\n```javascript\nlet answer = true;\nif (answer === false) {\n  return 0;\n} else {\n  return 10;\n}\n\n```\n- 10\n\n----------------------------------------------------------\n\n#### Q34. What is the result in the console of running the code shown?\n\n```javascript\nvar start = 1;\nfunction setEnd() {\n  var end = 10;\n}\nsetEnd();\nconsole.log(end);\n\n```\n- ReferenceError \n\n----------------------------------------------------------\n\n#### Q35. What will this code log in the console?\n\n```javascript\nfunction sayHello() {\n  console.log(\"hello\");\n}\n\nconsole.log(sayHello.prototype);\n\n```\n- undefined  \n\n----------------------------------------------------------\n\n#### Q36. Which collection object allows unique value to be inserted only once?\n\n- Set\n\n----------------------------------------------------------\n\n#### Q37. The following program has a problem. What is it?\n\n```javascript\nvar a;\nvar b = (a = 3) ? true: false\n\n```\n\n- The condition in the ternary is using the assignment operator.\n\n----------------------------------------------------------\n#### Q38. For the following class, how do you geet value of 42 from `x`?\n\n```javascript\n\nclass X{\n    get Y(){return 42;}\n}\nvar x = new X();\n\n```\n\n- x.Y\n\n----------------------------------------------------------\n#### Q39. What is the result?\n\n```javascript\n\nsum(10,20);\ndiff(10,20);\n\nfunction sum(x,y){\n  return x+y;\n}\n\nlet diff = function(x,y){\n  return x-y;\n}\n\n```\n\n- ReferenceError\n\n----------------------------------------------------------\n\n#### Q40. Which variable is an implicit parameter for every function in JavaScript?\n\n- Arguments\n\n----------------------------------------------------------\n\n#### Q41. What does the following expression evaluate to?\n```javascript\n\n[] == [];\n\n```\n- False\n\n----------------------------------------------------------\n\n#### Q42. Which statement is true about Functional Programming?\n\n- Side effects are not allowed.\n\n----------------------------------------------------------\n\n#### Q43. Which choice is not a unary operator?\n\n- instanceof\n\n----------------------------------------------------------\n\n#### Q44. What will the value of y be in this code:\n\n```javascript\n\nconst x = 6 % 2;\nconst y = x ? 'One' : 'Two';\n\n```\n\n- Two\n\n----------------------------------------------------------\n\n#### Q45. What value does this code return?\n\n```javascript\n\nlet answer = true;\nif (answer === false) {\n  return 0;\n} else {\n  return 10;\n}\n\n```\n\n- 10\n\n----------------------------------------------------------\n\n#### Q46.  What two values will this code print?\n\n```javascript\n\nfunction printA() {\n  console.log(answer);\n  var answer = 1;\n}\nprintA();\nprintA();\n\n```\n\n- undefined then undefined\n\n----------------------------------------------------------\n\n#### Q47.  Why might you choose to make your code asynchronous?\n\n- to start tasks that might take some time without blocking subsequent tasks from executing immediately\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadrinlol%2Flinkedin-javascript-assessment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadrinlol%2Flinkedin-javascript-assessment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadrinlol%2Flinkedin-javascript-assessment/lists"}