\\\\n\\\\n[/code]\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"This fires the \\\\\\\"myCallback()\\\\\\\" function when the [code=html][/code] is loaded into the ...\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"questionPageImpressionHash\":\"answer_ranking|1972960414\",\"viewerHasAccess\":false,\"feedbackSurveyVariant\":0,\"tribeItem\":null,\"__typename\":\"Answer\",\"viewHash\":\"a-4863804_8686e2e133b3acccbcdc200d7107aeed\",\"isSelectedForDigestClickthroughSurvey\":false,\"question\":{\"qid\":1835596,\"id\":\"UXVlc3Rpb25AMDoxODM1NTk2\",\"isDeleted\":false,\"url\":\"/What-is-the-difference-between-load-functions-and-callback-functions-in-JavaScript\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"What is the difference between load functions and callback functions in JavaScript?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"__typename\":\"Question\",\"isPartnerQuestion\":false,\"isTrendyQuestion\":false,\"isFollowUpQuestion\":false,\"asker\":{\"id\":\"VXNlckAwOjIyMTAwMTE1Mw==\",\"__typename\":\"User\",\"isEmployee\":false,\"uid\":221001153},\"slug\":\"What-is-the-difference-between-load-functions-and-callback-functions-in-JavaScript\",\"network\":{\"nid\":0,\"id\":\"TmV0d29yazow\"},\"tribeItem\":null,\"answerCount\":2,\"suggestedReplies\":[]},\"permaUrl\":\"/What-is-the-difference-between-load-functions-and-callback-functions-in-JavaScript/answer/Giordon-Stark\",\"isVisibleToViewer\":true,\"viewerIsAuthor\":false,\"isShortContent\":false,\"permaUrlOnOriginalQuestion\":\"/What-is-the-difference-between-load-functions-and-callback-functions-in-JavaScript/answer/Giordon-Stark\",\"viewerCanRestoreAnswer\":false,\"__isMonetizable\":\"Answer\",\"oid\":4863804,\"contentType\":\"answer\",\"tribe\":null,\"viewer\":{\"consumerBundleSubscription\":null,\"id\":\"Vmlld2VyQDA6MA==\",\"tribeDirectSubscriptions\":[],\"user\":null,\"staticContent\":{\"title\":\"There is help\",\"contentQtextDocument\":{\"legacyJson\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"Need Help? Contact a suicide hotline if you need someone to talk to. If you have a friend in need of help, please encourage that person to contact a suicide hotline as well.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Worldwide\\\\nIn general, if you're outside the US, numbers for your country are here: \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"Help a friend - Befrienders Worldwide\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"http://www.befrienders.org/support/helplines.asp\\\"}}}, {\\\"text\\\": \\\". You can also e-mail \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"jo@samaritans.org\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"mailto:jo@samaritans.org\\\"}}}, {\\\"text\\\": \\\" to talk to someone or visit \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"samaritans.org\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"https://www.samaritans.org/how-we-can-help-you/contact-us\\\"}}}, {\\\"text\\\": \\\" to speak with someone.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"unordered-list\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"United States\\\\nCall the \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"National Suicide Prevention Lifeline\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"https://suicidepreventionlifeline.org/\\\"}}}, {\\\"text\\\": \\\" at 1-800-273-TALK (8255).\\\\nPara espa\\u00f1ol, llame al \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"1-888-628-9454\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"#\\\"}}}, {\\\"text\\\": \\\".\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"unordered-list\\\", \\\"is_rtl\\\": false}]}\",\"id\":\"UXRleHREb2N1bWVudEAwOjkzYzA5ZjNjYjc4MmRkNGEzMWFiMTRmNjhiMWU2YzIz\"},\"staticContentType\":\"suicide_prevention_message\",\"internalUrl\":\"\",\"id\":\"U3RhdGljQ29udGVudEAwOnN1aWNpZGVfcHJldmVudGlvbl9tZXNzYWdl\"}},\"author\":{\"id\":\"VXNlckAwOjMzMzc3OTc=\",\"uid\":3337797,\"__typename\":\"User\",\"useTranslatedName\":false,\"isMachineAnswerBot\":false,\"names\":[{\"__typename\":\"UserName\",\"id\":\"VXNlck5hbWU6MzMzNzc5NzpMQVRO\",\"reverseOrder\":false,\"givenName\":\"Giordon\",\"familyName\":\"Stark\",\"scriptCode\":\"LATN\"}],\"adminNames\":[],\"isAnon\":false,\"profileUrl\":\"/profile/Giordon-Stark\",\"smallProfileImageUrl\":\"https://qph.cf2.quoracdn.net/main-thumb-3337797-50-mbpvfvaciqwustbmxrkkcuhqqyflhjte.jpeg\",\"profileImageUrl\":\"https://qph.cf2.quoracdn.net/main-thumb-3337797-200-mbpvfvaciqwustbmxrkkcuhqqyflhjte.jpeg\",\"isVerified\":false,\"businessStatus\":null,\"consumerBundleActive\":false,\"producerBundleStatus\":\"enabled\",\"viewerHasMuted\":false},\"__isContentObject\":\"Answer\",\"shouldBlurAllImages\":false,\"creationTime\":1398210344781537,\"hasSuicideTopics\":false,\"updatedTime\":1398210361977436,\"authorTribeUser\":null,\"__isCredentialContainer\":\"Answer\",\"authorCredential\":{\"id\":\"TGlmZUV4cGVyaWVuY2VDcmVkZW50aWFsQDA6MTc4ODAyMQ==\",\"__typename\":\"LifeExperienceCredential\",\"__isCredential\":\"LifeExperienceCredential\",\"translatedString\":\"taught at Caltech\",\"experience\":{\"id\":\"VG9waWNAMDoxMTYy\",\"__typename\":\"Topic\",\"tid\":1162,\"name\":\"Web Development\"},\"description\":\"taught at Caltech\",\"isDefault\":false,\"isBad\":false,\"isEnqueued\":false,\"credentialId\":1788021},\"isTranslated\":false,\"url\":\"/What-is-the-difference-between-load-functions-and-callback-functions-in-JavaScript/answer/Giordon-Stark\",\"isOwnTranslation\":false,\"businessCredential\":null,\"businessAnswer\":null,\"credibilityFacts\":[{\"__typename\":\"AuthorInfoFact\",\"id\":\"QXV0aG9ySW5mb0ZhY3RAMDo0ODYzODA0OlsxMDgxLCA2NjgzMzY5XQ==\",\"viewCount\":6683369,\"answerCount\":1081}],\"sourceNetwork\":null,\"sourceQuestion\":null,\"sourceAnswer\":null,\"effectiveAccessOption\":\"smart_distribution\",\"monetizationIneligibilityReasons\":[],\"notForReproduction\":false,\"numViews\":1015,\"__isVotable\":\"Answer\",\"numUpvotes\":4,\"__isQuoraShareable\":\"Answer\",\"numShares\":0,\"moderationCollapseType\":null,\"numRequesters\":0,\"requesters\":[],\"isCommentsDisabled\":false,\"isCollapsedForViewer\":false,\"isModerationLocked\":false,\"moderationCollapseTypeUrl\":null,\"network\":{\"id\":\"TmV0d29yazow\",\"__typename\":\"Network\",\"contentLanguageCode\":\"en\",\"appealsFormUrl\":\"https://help.quora.com/hc/en/requests/new?ticket_form_id=198746\"},\"collapseOperation\":null,\"numDisplayComments\":0,\"__isReportable\":\"Answer\",\"reportableId\":4863804,\"canViewerReport\":false,\"viewerVoteType\":\"novote\"}},\"cursor\":\"24\"},{\"id\":\"UXVlc3Rpb25QYWdlZExpc3RFZGdlOjI1\",\"__typename\":\"QuestionPagedListEdge\",\"node\":{\"id\":\"UXVlc3Rpb25SZWxldmFudEFuc3dlckl0ZW0yQDA6MzIzNTkyNjphbnN3ZXI6NzMxNTM3MA==\",\"__typename\":\"QuestionRelevantAnswerItem2\",\"__isQuestionPagedListItem\":\"QuestionRelevantAnswerItem2\",\"question\":{\"qid\":3235926,\"id\":\"UXVlc3Rpb25AMDozMjM1OTI2\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"What is a simple explanation of higher order functions and callbacks in JavaScript?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"isQuestionDecanonActive\":true,\"areRelatedAnswersEnabled\":true},\"index\":21,\"isEquivalentAnswer\":false,\"relatedQuestion\":{\"qid\":2518904,\"id\":\"UXVlc3Rpb25AMDoyNTE4OTA0\"},\"answer\":{\"originalQuestionIfDifferent\":{\"question\":{\"qid\":2518904,\"id\":\"UXVlc3Rpb25AMDoyNTE4OTA0\",\"url\":\"/Why-are-callbacks-in-JavaScript-called-callbacks\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"Why are callbacks in JavaScript called callbacks?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"__typename\":\"Question\",\"isPartnerQuestion\":false,\"isTrendyQuestion\":false,\"isFollowUpQuestion\":false,\"asker\":{\"id\":\"VXNlckAwOjIyMTAwMTE1Mw==\",\"__typename\":\"User\",\"isEmployee\":false,\"uid\":221001153},\"slug\":\"Why-are-callbacks-in-JavaScript-called-callbacks\",\"network\":{\"nid\":0,\"id\":\"TmV0d29yazow\"},\"tribeItem\":null,\"debugInfo\":\"{}\",\"viewer\":{\"user\":null,\"id\":\"Vmlld2VyQDA6MA==\"}},\"id\":\"T3JpZ2luYWxseUFuc3dlcmVkUXVlc3Rpb25AMDo3MzE1MzcwOjI1MTg5MDQ=\",\"originalQuestionText\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"Why callbacks in JavaScript called callbacks?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"isQuestionBannerRemoved\":false},\"id\":\"QW5zd2VyQDA6NzMxNTM3MA==\",\"aid\":7315370,\"isDeleted\":false,\"isMachineAnswer\":false,\"content\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"A callback is a function whose express purpose is to be invoked by the executed method at some semantically important time. Frequently with an asynchronously obtained result. It is literally called back.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Here is a metaphor. You call a plumber to fix your pipe, but he's not in the office. You leave your name, and a number where you can be reached, so that the plumber can call you back. Same thing.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"\\\", \\\"modifiers\\\": {\\\"image\\\": \\\"https://qph.cf2.quoracdn.net/main-qimg-49228d79917fdd57e0ed3513c942dc97-lq\\\", \\\"height\\\": 225, \\\"width\\\": 300, \\\"master_url\\\": \\\"https://qph.cf2.quoracdn.net/main-qimg-49228d79917fdd57e0ed3513c942dc97-lq\\\", \\\"is_deleted\\\": false, \\\"is_sensitive\\\": false, \\\"is_uploaded_by_bot\\\": false, \\\"dominant_color\\\": \\\"#5d331e\\\"}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"image\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"What's that? I'm a little busy right now, tell him I'll call him back.\\\", \\\"modifiers\\\": {\\\"italic\\\": true}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"In node.js callbacks are used everywhere, so much so that there is a standard definition for such callbacks, each expecting two parameters, one for an possible error, the other with the result of the call. For example, the call to get the listing of the files in a directory, fs.readdir (\\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"Node.js v0.10.32 Manual & Documentation\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"http://nodejs.org/api/fs.html#fs_fs_readdir_path_callback\\\"}}}, {\\\"text\\\": \\\"). This function takes two parameters, the path and the callback that receives the result. And as is pretty standard in node, the callback will be invoked with two parameters, the first contains an error if there was one, and the second will have an array of file and directory names--the result of the function.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"questionPageImpressionHash\":\"answer_ranking|618651060\",\"viewerHasAccess\":true,\"feedbackSurveyVariant\":0,\"tribeItem\":null,\"__typename\":\"Answer\",\"viewHash\":\"a-7315370_268f22bc7d0b6292af9cd1070a7df7d4\",\"isSelectedForDigestClickthroughSurvey\":false,\"question\":{\"qid\":2518904,\"id\":\"UXVlc3Rpb25AMDoyNTE4OTA0\",\"isDeleted\":false,\"url\":\"/Why-are-callbacks-in-JavaScript-called-callbacks\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"Why are callbacks in JavaScript called callbacks?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"__typename\":\"Question\",\"isPartnerQuestion\":false,\"isTrendyQuestion\":false,\"isFollowUpQuestion\":false,\"asker\":{\"id\":\"VXNlckAwOjIyMTAwMTE1Mw==\",\"__typename\":\"User\",\"isEmployee\":false,\"uid\":221001153},\"slug\":\"Why-are-callbacks-in-JavaScript-called-callbacks\",\"network\":{\"nid\":0,\"id\":\"TmV0d29yazow\"},\"tribeItem\":null,\"answerCount\":3,\"suggestedReplies\":[\"Can you explain the difference between callbacks and promises in JavaScript?\",\"What are some common pitfalls when using callbacks?\",\"How do arrow functions affect the use of callbacks?\"]},\"permaUrl\":\"/Why-are-callbacks-in-JavaScript-called-callbacks/answer/Glenn-Anderson\",\"isVisibleToViewer\":true,\"viewerIsAuthor\":false,\"isShortContent\":false,\"permaUrlOnOriginalQuestion\":\"/Why-are-callbacks-in-JavaScript-called-callbacks/answer/Glenn-Anderson\",\"viewerCanRestoreAnswer\":false,\"__isMonetizable\":\"Answer\",\"oid\":7315370,\"contentType\":\"answer\",\"tribe\":null,\"viewer\":{\"consumerBundleSubscription\":null,\"id\":\"Vmlld2VyQDA6MA==\",\"tribeDirectSubscriptions\":[],\"user\":null,\"staticContent\":{\"title\":\"There is help\",\"contentQtextDocument\":{\"legacyJson\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"Need Help? Contact a suicide hotline if you need someone to talk to. If you have a friend in need of help, please encourage that person to contact a suicide hotline as well.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Worldwide\\\\nIn general, if you're outside the US, numbers for your country are here: \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"Help a friend - Befrienders Worldwide\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"http://www.befrienders.org/support/helplines.asp\\\"}}}, {\\\"text\\\": \\\". You can also e-mail \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"jo@samaritans.org\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"mailto:jo@samaritans.org\\\"}}}, {\\\"text\\\": \\\" to talk to someone or visit \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"samaritans.org\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"https://www.samaritans.org/how-we-can-help-you/contact-us\\\"}}}, {\\\"text\\\": \\\" to speak with someone.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"unordered-list\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"United States\\\\nCall the \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"National Suicide Prevention Lifeline\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"https://suicidepreventionlifeline.org/\\\"}}}, {\\\"text\\\": \\\" at 1-800-273-TALK (8255).\\\\nPara espa\\u00f1ol, llame al \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"1-888-628-9454\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"#\\\"}}}, {\\\"text\\\": \\\".\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"unordered-list\\\", \\\"is_rtl\\\": false}]}\",\"id\":\"UXRleHREb2N1bWVudEAwOjkzYzA5ZjNjYjc4MmRkNGEzMWFiMTRmNjhiMWU2YzIz\"},\"staticContentType\":\"suicide_prevention_message\",\"internalUrl\":\"\",\"id\":\"U3RhdGljQ29udGVudEAwOnN1aWNpZGVfcHJldmVudGlvbl9tZXNzYWdl\"}},\"author\":{\"id\":\"VXNlckAwOjMzOTUyMzg=\",\"uid\":3395238,\"__typename\":\"User\",\"useTranslatedName\":false,\"isMachineAnswerBot\":false,\"names\":[{\"__typename\":\"UserName\",\"id\":\"VXNlck5hbWU6MzM5NTIzODpMQVRO\",\"reverseOrder\":false,\"givenName\":\"Glenn\",\"familyName\":\"Anderson\",\"scriptCode\":\"LATN\"}],\"adminNames\":[],\"isAnon\":false,\"profileUrl\":\"/profile/Glenn-Anderson\",\"smallProfileImageUrl\":\"https://qph.cf2.quoracdn.net/main-thumb-3395238-50-mpczndtoiubulezgrrkacmenuisemvhn.jpeg\",\"profileImageUrl\":\"https://qph.cf2.quoracdn.net/main-thumb-3395238-200-mpczndtoiubulezgrrkacmenuisemvhn.jpeg\",\"isVerified\":false,\"businessStatus\":null,\"consumerBundleActive\":false,\"producerBundleStatus\":\"never_enrolled\",\"viewerHasMuted\":false},\"__isContentObject\":\"Answer\",\"shouldBlurAllImages\":false,\"creationTime\":1412349234304315,\"hasSuicideTopics\":false,\"updatedTime\":1412349700810023,\"authorTribeUser\":null,\"__isCredentialContainer\":\"Answer\",\"authorCredential\":{\"id\":\"RnJlZUZvcm1DcmVkZW50aWFsQDA6MTM1MDEx\",\"__typename\":\"FreeFormCredential\",\"__isCredential\":\"FreeFormCredential\",\"translatedString\":\"Another hairless ape.\",\"credentialId\":135011,\"isDefault\":false,\"isBad\":false,\"isEnqueued\":false,\"experience\":\"Another hairless ape.\"},\"isTranslated\":false,\"url\":\"/Why-are-callbacks-in-JavaScript-called-callbacks/answer/Glenn-Anderson\",\"isOwnTranslation\":false,\"businessCredential\":null,\"businessAnswer\":null,\"credibilityFacts\":[{\"__typename\":\"AuthorInfoFact\",\"id\":\"QXV0aG9ySW5mb0ZhY3RAMDo3MzE1MzcwOlsxNTgyLCA0MTQyMDM4XQ==\",\"viewCount\":4142038,\"answerCount\":1582}],\"sourceNetwork\":null,\"sourceQuestion\":null,\"sourceAnswer\":null,\"effectiveAccessOption\":\"free\",\"monetizationIneligibilityReasons\":[],\"notForReproduction\":false,\"numViews\":2251,\"__isVotable\":\"Answer\",\"numUpvotes\":4,\"__isQuoraShareable\":\"Answer\",\"numShares\":0,\"moderationCollapseType\":null,\"numRequesters\":0,\"requesters\":[],\"isCommentsDisabled\":false,\"isCollapsedForViewer\":false,\"isModerationLocked\":false,\"moderationCollapseTypeUrl\":null,\"network\":{\"id\":\"TmV0d29yazow\",\"__typename\":\"Network\",\"contentLanguageCode\":\"en\",\"appealsFormUrl\":\"https://help.quora.com/hc/en/requests/new?ticket_form_id=198746\"},\"collapseOperation\":null,\"numDisplayComments\":0,\"__isReportable\":\"Answer\",\"reportableId\":7315370,\"canViewerReport\":false,\"viewerVoteType\":\"novote\"}},\"cursor\":\"25\"},{\"id\":\"UXVlc3Rpb25QYWdlZExpc3RFZGdlOjI2\",\"__typename\":\"QuestionPagedListEdge\",\"node\":{\"id\":\"UXVlc3Rpb25SZWxldmFudEFuc3dlckl0ZW0yQDA6MzIzNTkyNjphbnN3ZXI6MjEwMzk3NDgw\",\"__typename\":\"QuestionRelevantAnswerItem2\",\"__isQuestionPagedListItem\":\"QuestionRelevantAnswerItem2\",\"question\":{\"qid\":3235926,\"id\":\"UXVlc3Rpb25AMDozMjM1OTI2\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"What is a simple explanation of higher order functions and callbacks in JavaScript?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"isQuestionDecanonActive\":true,\"areRelatedAnswersEnabled\":true},\"index\":22,\"isEquivalentAnswer\":false,\"relatedQuestion\":{\"qid\":69628514,\"id\":\"UXVlc3Rpb25AMDo2OTYyODUxNA==\"},\"answer\":{\"originalQuestionIfDifferent\":null,\"id\":\"QW5zd2VyQDA6MjEwMzk3NDgw\",\"aid\":210397480,\"isDeleted\":false,\"isMachineAnswer\":false,\"content\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"A \\\\u201chigher-order function\\\\u201d is a function that either takes another function as an argument, or returns another function, or both. It\\\\u2019s a function that operates on functions.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"For example, in Python we might write\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"def apply_twice( f, x ):\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" return f(f(x))\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"this takes a function (or other callable!) as an argument, \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"f\\\", \\\"modifiers\\\": {\\\"code\\\": true}}, {\\\"text\\\": \\\", then uses that function.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"A callback function is a means of having a procedure \\\\u201creturn control\\\\u201d\\\\u2014 \\\\u201ccall back\\\\u201d\\\\u2014 to code provided by its caller. See \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"What is meant by a callback function?\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"question\\\", \\\"qid\\\": 19558222, \\\"url\\\": \\\"https://www.quora.com/What-is-meant-by-a-callback-function\\\"}}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"The relationship is that a callback function is \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"usually\\\", \\\"modifiers\\\": {\\\"italic\\\": true}}, {\\\"text\\\": \\\" an argument to a higher-order function. The callback function must be provided, in some form, in order for the procedure to use it, and the simplest is to pass it as a parameter.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"horizontal-rule\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Here\\\\u2019s an example. Suppose you have lengthy calculation to perform, but you want the ability to periodically report status, or maybe interrupt the calculation and restart it. You could do that as a higher-order function that takes a callback as one of its arguments:\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"def my_complicated_function( parameter1, parameter2, callback ):\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" ...\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" // somewhere in the code\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" if callback( status ) == QUIT:\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" // clean up here\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" return\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" ...\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"In this example, \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"my_complicated_function\\\", \\\"modifiers\\\": {\\\"code\\\": true}}, {\\\"text\\\": \\\" is a higher-order function.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"But that\\\\u2019s not the only way we could provide the procedure with a callback function. We could have callback be a module-level variable:\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"callback = default_callback_function\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"def my_complicated_function( parameter1, parameter2 ):\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" ...\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Or, we could put the function in a class, and require users to override that class if they want different callback behavior than the default:\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"class Foo(object):\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" def callback( self, status ):\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" // do nothing by default\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" pass\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" def my_complicated_function( self, parameter1, parameter2 ):\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" ...\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" self.callback( status ) etc.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"These examples show that while a callback function is typically a parameter, it need not be.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"questionPageImpressionHash\":\"answer_ranking|-860455399\",\"viewerHasAccess\":true,\"feedbackSurveyVariant\":0,\"tribeItem\":null,\"__typename\":\"Answer\",\"viewHash\":\"a-210397480_9db6001387dcc513d71ae8625f0c0dd8\",\"isSelectedForDigestClickthroughSurvey\":false,\"question\":{\"qid\":69628514,\"id\":\"UXVlc3Rpb25AMDo2OTYyODUxNA==\",\"isDeleted\":false,\"url\":\"/What-is-the-relationship-between-a-higher-order-function-and-a-callback-function\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"What is the relationship between a higher order function and a callback function?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"__typename\":\"Question\",\"isPartnerQuestion\":false,\"isTrendyQuestion\":false,\"isFollowUpQuestion\":false,\"asker\":{\"id\":\"VXNlckAwOjQyMDQ4MTYyMg==\",\"__typename\":\"User\",\"isEmployee\":false,\"uid\":420481622},\"slug\":\"What-is-the-relationship-between-a-higher-order-function-and-a-callback-function\",\"network\":{\"nid\":0,\"id\":\"TmV0d29yazow\"},\"tribeItem\":null,\"answerCount\":2,\"suggestedReplies\":[\"Can you explain how higher-order functions can improve code readability?\",\"What are some common pitfalls when using callback functions?\",\"How do promises relate to callback functions in JavaScript?\"]},\"permaUrl\":\"/What-is-the-relationship-between-a-higher-order-function-and-a-callback-function/answer/Mark-Gritter\",\"isVisibleToViewer\":true,\"viewerIsAuthor\":false,\"isShortContent\":false,\"permaUrlOnOriginalQuestion\":\"/What-is-the-relationship-between-a-higher-order-function-and-a-callback-function/answer/Mark-Gritter\",\"viewerCanRestoreAnswer\":false,\"__isMonetizable\":\"Answer\",\"oid\":210397480,\"contentType\":\"answer\",\"tribe\":null,\"viewer\":{\"consumerBundleSubscription\":null,\"id\":\"Vmlld2VyQDA6MA==\",\"tribeDirectSubscriptions\":[],\"user\":null,\"staticContent\":{\"title\":\"There is help\",\"contentQtextDocument\":{\"legacyJson\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"Need Help? Contact a suicide hotline if you need someone to talk to. If you have a friend in need of help, please encourage that person to contact a suicide hotline as well.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Worldwide\\\\nIn general, if you're outside the US, numbers for your country are here: \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"Help a friend - Befrienders Worldwide\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"http://www.befrienders.org/support/helplines.asp\\\"}}}, {\\\"text\\\": \\\". You can also e-mail \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"jo@samaritans.org\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"mailto:jo@samaritans.org\\\"}}}, {\\\"text\\\": \\\" to talk to someone or visit \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"samaritans.org\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"https://www.samaritans.org/how-we-can-help-you/contact-us\\\"}}}, {\\\"text\\\": \\\" to speak with someone.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"unordered-list\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"United States\\\\nCall the \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"National Suicide Prevention Lifeline\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"https://suicidepreventionlifeline.org/\\\"}}}, {\\\"text\\\": \\\" at 1-800-273-TALK (8255).\\\\nPara espa\\u00f1ol, llame al \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"1-888-628-9454\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"#\\\"}}}, {\\\"text\\\": \\\".\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"unordered-list\\\", \\\"is_rtl\\\": false}]}\",\"id\":\"UXRleHREb2N1bWVudEAwOjkzYzA5ZjNjYjc4MmRkNGEzMWFiMTRmNjhiMWU2YzIz\"},\"staticContentType\":\"suicide_prevention_message\",\"internalUrl\":\"\",\"id\":\"U3RhdGljQ29udGVudEAwOnN1aWNpZGVfcHJldmVudGlvbl9tZXNzYWdl\"}},\"author\":{\"id\":\"VXNlckAwOjE5NTkwMzk=\",\"uid\":1959039,\"__typename\":\"User\",\"useTranslatedName\":false,\"isMachineAnswerBot\":false,\"names\":[{\"__typename\":\"UserName\",\"id\":\"VXNlck5hbWU6MTk1OTAzOTpMQVRO\",\"reverseOrder\":false,\"givenName\":\"Mark\",\"familyName\":\"Gritter\",\"scriptCode\":\"LATN\"}],\"adminNames\":[],\"isAnon\":false,\"profileUrl\":\"/profile/Mark-Gritter\",\"smallProfileImageUrl\":\"https://qph.cf2.quoracdn.net/main-thumb-1959039-50-pumeoeyasujlwzudakrqrfhieircdzgv.jpeg\",\"profileImageUrl\":\"https://qph.cf2.quoracdn.net/main-thumb-1959039-200-pumeoeyasujlwzudakrqrfhieircdzgv.jpeg\",\"isVerified\":false,\"businessStatus\":null,\"consumerBundleActive\":false,\"producerBundleStatus\":\"never_enrolled\",\"viewerHasMuted\":false},\"__isContentObject\":\"Answer\",\"shouldBlurAllImages\":false,\"creationTime\":1587348843069484,\"hasSuicideTopics\":false,\"updatedTime\":0,\"authorTribeUser\":null,\"__isCredentialContainer\":\"Answer\",\"authorCredential\":{\"id\":\"TGlmZUV4cGVyaWVuY2VDcmVkZW50aWFsQDA6MTQ0Njg5Nw==\",\"__typename\":\"LifeExperienceCredential\",\"__isCredential\":\"LifeExperienceCredential\",\"translatedString\":\"recreational mathematician\",\"experience\":{\"id\":\"VG9waWNAMDo5NTE=\",\"__typename\":\"Topic\",\"tid\":951,\"name\":\"Mathematics\"},\"description\":\"recreational mathematician\",\"isDefault\":false,\"isBad\":false,\"isEnqueued\":false,\"credentialId\":1446897},\"isTranslated\":false,\"url\":\"/What-is-the-relationship-between-a-higher-order-function-and-a-callback-function/answer/Mark-Gritter\",\"isOwnTranslation\":false,\"businessCredential\":null,\"businessAnswer\":null,\"credibilityFacts\":[{\"__typename\":\"AuthorInfoFact\",\"id\":\"QXV0aG9ySW5mb0ZhY3RAMDoyMTAzOTc0ODA6WzU2NDUsIDExMzcyMzM0XQ==\",\"viewCount\":11372334,\"answerCount\":5645}],\"sourceNetwork\":null,\"sourceQuestion\":null,\"sourceAnswer\":null,\"effectiveAccessOption\":\"free\",\"monetizationIneligibilityReasons\":[],\"notForReproduction\":false,\"numViews\":799,\"__isVotable\":\"Answer\",\"numUpvotes\":3,\"__isQuoraShareable\":\"Answer\",\"numShares\":0,\"moderationCollapseType\":null,\"numRequesters\":1,\"requesters\":[{\"id\":\"VXNlckAwOjQyMDQ4MTYyMg==\",\"__typename\":\"User\",\"uid\":420481622,\"isAnon\":false,\"useTranslatedName\":false,\"isMachineAnswerBot\":false,\"names\":[{\"__typename\":\"UserName\",\"id\":\"VXNlck5hbWU6NDIwNDgxNjIyOkxBVE4=\",\"reverseOrder\":false,\"givenName\":\"Davidson\",\"familyName\":\"Julot\",\"scriptCode\":\"LATN\"}],\"adminNames\":[],\"profileUrl\":\"/profile/Davidson-Julot-1\"}],\"isCommentsDisabled\":false,\"isCollapsedForViewer\":false,\"isModerationLocked\":false,\"moderationCollapseTypeUrl\":null,\"network\":{\"id\":\"TmV0d29yazow\",\"__typename\":\"Network\",\"contentLanguageCode\":\"en\",\"appealsFormUrl\":\"https://help.quora.com/hc/en/requests/new?ticket_form_id=198746\"},\"collapseOperation\":null,\"numDisplayComments\":0,\"__isReportable\":\"Answer\",\"reportableId\":210397480,\"canViewerReport\":false,\"viewerVoteType\":\"novote\"}},\"cursor\":\"26\"},{\"id\":\"UXVlc3Rpb25QYWdlZExpc3RFZGdlOjI3\",\"__typename\":\"QuestionPagedListEdge\",\"node\":{\"id\":\"UXVlc3Rpb25SZWxldmFudEFuc3dlckl0ZW0yQDA6MzIzNTkyNjphbnN3ZXI6MTQ3Nzc0MzY5MTM5OTQyMg==\",\"__typename\":\"QuestionRelevantAnswerItem2\",\"__isQuestionPagedListItem\":\"QuestionRelevantAnswerItem2\",\"question\":{\"qid\":3235926,\"id\":\"UXVlc3Rpb25AMDozMjM1OTI2\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"What is a simple explanation of higher order functions and callbacks in JavaScript?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"isQuestionDecanonActive\":true,\"areRelatedAnswersEnabled\":true},\"index\":23,\"isEquivalentAnswer\":false,\"relatedQuestion\":{\"qid\":20092102,\"id\":\"UXVlc3Rpb25AMDoyMDA5MjEwMg==\"},\"answer\":{\"originalQuestionIfDifferent\":null,\"id\":\"QW5zd2VyQDA6MTQ3Nzc0MzY5MTM5OTQyMg==\",\"aid\":1477743691399422,\"isDeleted\":false,\"isMachineAnswer\":false,\"content\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"Promises are used to control asynchronous actions in JavaScript. It provides reassurance that action will be taken. The promise controls what occurs after the asynchronous event has happened and is used to track whether the event has been executed or not.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Four states make up a promise:\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"fulfilled: The promise's associated action was successful\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"rejected: Action related to the promise failed\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"pending: Promise is still pending i.e. not fulfilled or rejected yet\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"settled: Promise has fulfilled or rejected\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"The callback function that is sent as the sole input to the promise constructor is also referred to as an anonymous function.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Reject and resolve are the two arguments that callback function takes.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"If everything went successfully, do activities inside the callback function and then call resolve.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Call for rejection if intended operations don't go as planned.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Callbacks are a fantastic way to take care of something once another action has been completed. In this case, \\\\\\\"something\\\\\\\" is the performance of a function. If we want to run a function right after another function returns, we can do it by using callbacks.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Objects are the kind of function in JavaScript. Therefore, when calling them, they can be passed as an argument to any other function, just like any other objects (Strings, Arrays, etc.).\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"After awaiting the result of a previous function call, you can execute another function call.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"You can transmit data from the child function to the parent function as well as call the parent function from the child function.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"When using the callback strategy, we often merely send a callback into a function that would then be called upon completion in order to retrieve the outcome of something, which is a fundamental difference between the two. But with promises, you may affix callbacks to the promise object that is returned.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"questionPageImpressionHash\":\"answer_ranking|1614397240\",\"viewerHasAccess\":true,\"feedbackSurveyVariant\":0,\"tribeItem\":null,\"__typename\":\"Answer\",\"viewHash\":\"a-1477743691399422_cbfcaceab967f6e737c1a5f9892a52d5\",\"isSelectedForDigestClickthroughSurvey\":false,\"question\":{\"qid\":20092102,\"id\":\"UXVlc3Rpb25AMDoyMDA5MjEwMg==\",\"isDeleted\":false,\"url\":\"/What-is-the-difference-between-callback-function-and-promise-in-JavaScript\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"What is the difference between callback function and promise in JavaScript?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"__typename\":\"Question\",\"isPartnerQuestion\":false,\"isTrendyQuestion\":false,\"isFollowUpQuestion\":false,\"asker\":{\"id\":\"VXNlckAwOjE3MjE0MDE0Ng==\",\"__typename\":\"User\",\"isEmployee\":false,\"uid\":172140146},\"slug\":\"What-is-the-difference-between-callback-function-and-promise-in-JavaScript\",\"network\":{\"nid\":0,\"id\":\"TmV0d29yazow\"},\"tribeItem\":null,\"answerCount\":3,\"suggestedReplies\":[\"Can you explain how async/await relates to promises?\",\"What are some common pitfalls when using callbacks?\",\"How do I convert a callback-based function to use promises?\"]},\"permaUrl\":\"/What-is-the-difference-between-callback-function-and-promise-in-JavaScript/answer/Coding-Ninjas-1\",\"isVisibleToViewer\":true,\"viewerIsAuthor\":false,\"isShortContent\":false,\"permaUrlOnOriginalQuestion\":\"/What-is-the-difference-between-callback-function-and-promise-in-JavaScript/answer/Coding-Ninjas-1\",\"viewerCanRestoreAnswer\":false,\"__isMonetizable\":\"Answer\",\"oid\":1477743691399422,\"contentType\":\"answer\",\"tribe\":null,\"viewer\":{\"consumerBundleSubscription\":null,\"id\":\"Vmlld2VyQDA6MA==\",\"tribeDirectSubscriptions\":[],\"user\":null,\"staticContent\":{\"title\":\"There is help\",\"contentQtextDocument\":{\"legacyJson\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"Need Help? Contact a suicide hotline if you need someone to talk to. If you have a friend in need of help, please encourage that person to contact a suicide hotline as well.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Worldwide\\\\nIn general, if you're outside the US, numbers for your country are here: \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"Help a friend - Befrienders Worldwide\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"http://www.befrienders.org/support/helplines.asp\\\"}}}, {\\\"text\\\": \\\". You can also e-mail \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"jo@samaritans.org\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"mailto:jo@samaritans.org\\\"}}}, {\\\"text\\\": \\\" to talk to someone or visit \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"samaritans.org\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"https://www.samaritans.org/how-we-can-help-you/contact-us\\\"}}}, {\\\"text\\\": \\\" to speak with someone.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"unordered-list\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"United States\\\\nCall the \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"National Suicide Prevention Lifeline\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"https://suicidepreventionlifeline.org/\\\"}}}, {\\\"text\\\": \\\" at 1-800-273-TALK (8255).\\\\nPara espa\\u00f1ol, llame al \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"1-888-628-9454\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"#\\\"}}}, {\\\"text\\\": \\\".\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"unordered-list\\\", \\\"is_rtl\\\": false}]}\",\"id\":\"UXRleHREb2N1bWVudEAwOjkzYzA5ZjNjYjc4MmRkNGEzMWFiMTRmNjhiMWU2YzIz\"},\"staticContentType\":\"suicide_prevention_message\",\"internalUrl\":\"\",\"id\":\"U3RhdGljQ29udGVudEAwOnN1aWNpZGVfcHJldmVudGlvbl9tZXNzYWdl\"}},\"author\":{\"id\":\"VXNlckAwOjMwMzYzODgwOQ==\",\"uid\":303638809,\"__typename\":\"User\",\"useTranslatedName\":false,\"isMachineAnswerBot\":false,\"names\":[{\"__typename\":\"UserName\",\"id\":\"VXNlck5hbWU6MzAzNjM4ODA5OkxBVE4=\",\"reverseOrder\":false,\"givenName\":\"Coding\",\"familyName\":\"Ninjas\",\"scriptCode\":\"LATN\"}],\"adminNames\":[],\"isAnon\":false,\"profileUrl\":\"/profile/Coding-Ninjas-1\",\"smallProfileImageUrl\":\"https://qph.cf2.quoracdn.net/main-thumb-303638809-50-dsilofhpfxnqifcwgzpglimllygekylz.jpeg\",\"profileImageUrl\":\"https://qph.cf2.quoracdn.net/main-thumb-303638809-200-dsilofhpfxnqifcwgzpglimllygekylz.jpeg\",\"isVerified\":false,\"businessStatus\":\"unverified\",\"consumerBundleActive\":false,\"producerBundleStatus\":\"never_enrolled\",\"viewerHasMuted\":false},\"__isContentObject\":\"Answer\",\"shouldBlurAllImages\":false,\"creationTime\":1693450917761052,\"hasSuicideTopics\":false,\"updatedTime\":0,\"authorTribeUser\":null,\"__isCredentialContainer\":\"Answer\",\"authorCredential\":{\"id\":\"TG9jYXRpb25DcmVkZW50aWFsQDA6MTczMDI2MDI1\",\"__typename\":\"LocationCredential\",\"__isCredential\":\"LocationCredential\",\"translatedString\":\"located in Gurugram, Haryana, India (2016-present)\",\"startYear\":\"2016\",\"endYear\":\"-1\",\"isDefault\":false,\"isBad\":false,\"isEnqueued\":false,\"locationName\":null,\"location\":{\"id\":\"VG9waWNAMDo2OTk1NQ==\",\"__typename\":\"Topic\",\"tid\":69955,\"name\":\"Gurugram, Haryana, India\"}},\"isTranslated\":false,\"url\":\"/What-is-the-difference-between-callback-function-and-promise-in-JavaScript/answer/Coding-Ninjas-1\",\"isOwnTranslation\":false,\"businessCredential\":null,\"businessAnswer\":null,\"credibilityFacts\":[{\"__typename\":\"AuthorInfoFact\",\"id\":\"QXV0aG9ySW5mb0ZhY3RAMDoxNDc3NzQzNjkxMzk5NDIyOlsxNjAsIDM2MDY0N10=\",\"viewCount\":360647,\"answerCount\":160}],\"sourceNetwork\":null,\"sourceQuestion\":null,\"sourceAnswer\":null,\"effectiveAccessOption\":\"free\",\"monetizationIneligibilityReasons\":[],\"notForReproduction\":false,\"numViews\":126,\"__isVotable\":\"Answer\",\"numUpvotes\":0,\"__isQuoraShareable\":\"Answer\",\"numShares\":0,\"moderationCollapseType\":null,\"numRequesters\":0,\"requesters\":[],\"isCommentsDisabled\":false,\"isCollapsedForViewer\":false,\"isModerationLocked\":false,\"moderationCollapseTypeUrl\":null,\"network\":{\"id\":\"TmV0d29yazow\",\"__typename\":\"Network\",\"contentLanguageCode\":\"en\",\"appealsFormUrl\":\"https://help.quora.com/hc/en/requests/new?ticket_form_id=198746\"},\"collapseOperation\":null,\"numDisplayComments\":0,\"__isReportable\":\"Answer\",\"reportableId\":1477743691399422,\"canViewerReport\":false,\"viewerVoteType\":\"novote\"}},\"cursor\":\"27\"},{\"id\":\"UXVlc3Rpb25QYWdlZExpc3RFZGdlOjI4\",\"__typename\":\"QuestionPagedListEdge\",\"node\":{\"id\":\"UXVlc3Rpb25SZWxldmFudEFuc3dlckl0ZW0yQDA6MzIzNTkyNjphbnN3ZXI6MjM5MDc0NjE3\",\"__typename\":\"QuestionRelevantAnswerItem2\",\"__isQuestionPagedListItem\":\"QuestionRelevantAnswerItem2\",\"question\":{\"qid\":3235926,\"id\":\"UXVlc3Rpb25AMDozMjM1OTI2\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"What is a simple explanation of higher order functions and callbacks in JavaScript?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"isQuestionDecanonActive\":true,\"areRelatedAnswersEnabled\":true},\"index\":24,\"isEquivalentAnswer\":false,\"relatedQuestion\":{\"qid\":77934106,\"id\":\"UXVlc3Rpb25AMDo3NzkzNDEwNg==\"},\"answer\":{\"originalQuestionIfDifferent\":null,\"id\":\"QW5zd2VyQDA6MjM5MDc0NjE3\",\"aid\":239074617,\"isDeleted\":false,\"isMachineAnswer\":false,\"content\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"Callback is just a function. But the specialty of this function is that it can hold the body of the code in itself and can be passed as an argument to another function where it can be invoked and the body of code be executed.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"A simple example would be :\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"const fn = function () { // some code };\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"const caller = function (fn) {\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"\\\\t// some code\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"\\\\tfn();\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"\\\\t// some code\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"}\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"You can see that the function \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"fn\\\", \\\"modifiers\\\": {\\\"italic\\\": true}}, {\\\"text\\\": \\\" is passed as an argument in the function \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"caller\\\", \\\"modifiers\\\": {\\\"italic\\\": true}}, {\\\"text\\\": \\\" . This is something , which languages like C or Java does not provide. (Java does now have similar functionality)\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Another example of it would be :\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"const func = function() {\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"\\\\t\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"\\\\tsomeMethod(arg1, function() {\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"\\\\t\\\\t// some code.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"\\\\t});\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"\\\\t// The function is passed anonymously as callback\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"}\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"The example is just another way to demonstrate how callbacks can be written.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Now coming to the question of \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"callback hell, \\\", \\\"modifiers\\\": {\\\"bold\\\": true}}, {\\\"text\\\": \\\"In certain cases where we may have multiple callbacks passed within nested function invocations, is a callback hell, which is a bad practice and causes huge readability problems.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Not only does it cause readability problems but reasoning capabilities become a cognitive overload.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"An example of callback hell would be.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"function func1 () {\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"\\\\t// some code\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"\\\\tfunc2(arg1, function() {\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"\\\\t\\\\t// some code\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"\\\\t\\\\tfunc2(arg2, function() {\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"\\\\t\\\\t\\\\t// some code\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"\\\\t\\\\t\\\\tfunc3(arg3, function() {\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"\\\\t\\\\t\\\\t\\\\t// some code\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"\\\\t\\\\t\\\\t\\\\tfunc4(arg4, function() {\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"\\\\t\\\\t\\\\t\\\\t\\\\t// some code\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"\\\\t\\\\t\\\\t\\\\t});\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"\\\\t\\\\t\\\\t});\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"\\\\t\\\\t});\\\\t\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"\\\\t});\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"}\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"You can see the pyramid type structure it has created\\\\u2026 This is very difficult to reason. Tying in with exception handling or adding \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"setTimeout\\\", \\\"modifiers\\\": {\\\"italic\\\": true}}, {\\\"text\\\": \\\"s in it makes it more difficult to debug and brings in chances of introducing bugs in code.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Hope this helps!!\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"questionPageImpressionHash\":\"answer_ranking|-225373351\",\"viewerHasAccess\":true,\"feedbackSurveyVariant\":0,\"tribeItem\":null,\"__typename\":\"Answer\",\"viewHash\":\"a-239074617_16d65817923c3574cdb3bd7b8e443a6c\",\"isSelectedForDigestClickthroughSurvey\":false,\"question\":{\"qid\":77934106,\"id\":\"UXVlc3Rpb25AMDo3NzkzNDEwNg==\",\"isDeleted\":false,\"url\":\"/What-do-you-understand-by-Callback-and-Callback-Hell-in-JavaScript\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"What do you understand by Callback and Callback Hell in JavaScript?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"__typename\":\"Question\",\"isPartnerQuestion\":false,\"isTrendyQuestion\":false,\"isFollowUpQuestion\":false,\"asker\":{\"id\":\"VXNlckAwOjIxMDIzMjkzNQ==\",\"__typename\":\"User\",\"isEmployee\":false,\"uid\":210232935},\"slug\":\"What-do-you-understand-by-Callback-and-Callback-Hell-in-JavaScript\",\"network\":{\"nid\":0,\"id\":\"TmV0d29yazow\"},\"tribeItem\":null,\"answerCount\":1,\"suggestedReplies\":[]},\"permaUrl\":\"/What-do-you-understand-by-Callback-and-Callback-Hell-in-JavaScript/answers/239074617\",\"isVisibleToViewer\":true,\"viewerIsAuthor\":false,\"isShortContent\":false,\"permaUrlOnOriginalQuestion\":\"/What-do-you-understand-by-Callback-and-Callback-Hell-in-JavaScript/answers/239074617\",\"viewerCanRestoreAnswer\":false,\"__isMonetizable\":\"Answer\",\"oid\":239074617,\"contentType\":\"answer\",\"tribe\":null,\"viewer\":{\"consumerBundleSubscription\":null,\"id\":\"Vmlld2VyQDA6MA==\",\"tribeDirectSubscriptions\":[],\"user\":null,\"staticContent\":{\"title\":\"There is help\",\"contentQtextDocument\":{\"legacyJson\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"Need Help? Contact a suicide hotline if you need someone to talk to. If you have a friend in need of help, please encourage that person to contact a suicide hotline as well.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Worldwide\\\\nIn general, if you're outside the US, numbers for your country are here: \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"Help a friend - Befrienders Worldwide\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"http://www.befrienders.org/support/helplines.asp\\\"}}}, {\\\"text\\\": \\\". You can also e-mail \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"jo@samaritans.org\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"mailto:jo@samaritans.org\\\"}}}, {\\\"text\\\": \\\" to talk to someone or visit \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"samaritans.org\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"https://www.samaritans.org/how-we-can-help-you/contact-us\\\"}}}, {\\\"text\\\": \\\" to speak with someone.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"unordered-list\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"United States\\\\nCall the \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"National Suicide Prevention Lifeline\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"https://suicidepreventionlifeline.org/\\\"}}}, {\\\"text\\\": \\\" at 1-800-273-TALK (8255).\\\\nPara espa\\u00f1ol, llame al \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"1-888-628-9454\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"#\\\"}}}, {\\\"text\\\": \\\".\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"unordered-list\\\", \\\"is_rtl\\\": false}]}\",\"id\":\"UXRleHREb2N1bWVudEAwOjkzYzA5ZjNjYjc4MmRkNGEzMWFiMTRmNjhiMWU2YzIz\"},\"staticContentType\":\"suicide_prevention_message\",\"internalUrl\":\"\",\"id\":\"U3RhdGljQ29udGVudEAwOnN1aWNpZGVfcHJldmVudGlvbl9tZXNzYWdl\"}},\"author\":{\"id\":\"VXNlckAwOjQxMjQ4MTUy\",\"uid\":41248152,\"__typename\":\"User\",\"useTranslatedName\":false,\"isMachineAnswerBot\":false,\"names\":[],\"adminNames\":[],\"isAnon\":false,\"profileUrl\":null,\"smallProfileImageUrl\":\"https://qsf.cf2.quoracdn.net/-4-images.new_grid.profile_default.png-26-688c79556f251aa0.png\",\"profileImageUrl\":\"https://qsf.cf2.quoracdn.net/-4-images.new_grid.profile_default.png-26-688c79556f251aa0.png\",\"isVerified\":false,\"businessStatus\":null,\"consumerBundleActive\":false,\"producerBundleStatus\":\"never_enrolled\",\"viewerHasMuted\":false},\"__isContentObject\":\"Answer\",\"shouldBlurAllImages\":false,\"creationTime\":1600225723526433,\"hasSuicideTopics\":false,\"updatedTime\":0,\"authorTribeUser\":null,\"__isCredentialContainer\":\"Answer\",\"authorCredential\":{\"id\":\"TGlmZUV4cGVyaWVuY2VDcmVkZW50aWFsQDA6OTk5ODE1NDk=\",\"__typename\":\"LifeExperienceCredential\",\"__isCredential\":\"LifeExperienceCredential\",\"translatedString\":\"Working for quite some time in Javascript\",\"experience\":{\"id\":\"VG9waWNAMDo5NDU=\",\"__typename\":\"Topic\",\"tid\":945,\"name\":\"JavaScript (programming language)\"},\"description\":\"Working for quite some time in Javascript\",\"isDefault\":false,\"isBad\":false,\"isEnqueued\":false,\"credentialId\":99981549},\"isTranslated\":false,\"url\":\"/What-do-you-understand-by-Callback-and-Callback-Hell-in-JavaScript/answers/239074617\",\"isOwnTranslation\":false,\"businessCredential\":null,\"businessAnswer\":null,\"credibilityFacts\":[{\"__typename\":\"AuthorInfoFact\",\"id\":\"QXV0aG9ySW5mb0ZhY3RAMDoyMzkwNzQ2MTc6WzExMiwgMzU5ODMwXQ==\",\"viewCount\":359830,\"answerCount\":112}],\"sourceNetwork\":null,\"sourceQuestion\":null,\"sourceAnswer\":null,\"effectiveAccessOption\":\"free\",\"monetizationIneligibilityReasons\":[],\"notForReproduction\":false,\"numViews\":556,\"__isVotable\":\"Answer\",\"numUpvotes\":1,\"__isQuoraShareable\":\"Answer\",\"numShares\":0,\"moderationCollapseType\":null,\"numRequesters\":1,\"requesters\":[{\"id\":\"VXNlckAwOjIxMDIzMjkzNQ==\",\"__typename\":\"User\",\"uid\":210232935,\"isAnon\":false,\"useTranslatedName\":false,\"isMachineAnswerBot\":false,\"names\":[{\"__typename\":\"UserName\",\"id\":\"VXNlck5hbWU6MjEwMjMyOTM1OkxBVE4=\",\"reverseOrder\":false,\"givenName\":\"Benu\",\"familyName\":\"Varghese\",\"scriptCode\":\"LATN\"}],\"adminNames\":[],\"profileUrl\":\"/profile/Benu-Varghese\"}],\"isCommentsDisabled\":false,\"isCollapsedForViewer\":false,\"isModerationLocked\":false,\"moderationCollapseTypeUrl\":null,\"network\":{\"id\":\"TmV0d29yazow\",\"__typename\":\"Network\",\"contentLanguageCode\":\"en\",\"appealsFormUrl\":\"https://help.quora.com/hc/en/requests/new?ticket_form_id=198746\"},\"collapseOperation\":null,\"numDisplayComments\":0,\"__isReportable\":\"Answer\",\"reportableId\":239074617,\"canViewerReport\":false,\"viewerVoteType\":\"novote\"}},\"cursor\":\"28\"},{\"id\":\"UXVlc3Rpb25QYWdlZExpc3RFZGdlOjI5\",\"__typename\":\"QuestionPagedListEdge\",\"node\":{\"id\":\"UXVlc3Rpb25SZWxldmFudEFuc3dlckl0ZW0yQDA6MzIzNTkyNjphbnN3ZXI6MzQyMTU1Nzk2\",\"__typename\":\"QuestionRelevantAnswerItem2\",\"__isQuestionPagedListItem\":\"QuestionRelevantAnswerItem2\",\"question\":{\"qid\":3235926,\"id\":\"UXVlc3Rpb25AMDozMjM1OTI2\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"What is a simple explanation of higher order functions and callbacks in JavaScript?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"isQuestionDecanonActive\":true,\"areRelatedAnswersEnabled\":true},\"index\":25,\"isEquivalentAnswer\":false,\"relatedQuestion\":{\"qid\":112547339,\"id\":\"UXVlc3Rpb25AMDoxMTI1NDczMzk=\"},\"answer\":{\"originalQuestionIfDifferent\":null,\"id\":\"QW5zd2VyQDA6MzQyMTU1Nzk2\",\"aid\":342155796,\"isDeleted\":false,\"isMachineAnswer\":false,\"content\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"It\\\\u2019s a combination of two factors. First, the environment that JavaScript was born in favors it. JavaScript in the browser is almost entirely event driven. Something happens to it, and you respond to what happened. You can do this by writing your own event loop where you ask for an event, determine what type of event it is, and then call the corresponding function, or you can just ask the engine to pass that type of event to a certain function, ie a callback.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"I\\\\u2019ve written enough code using the former model to say that especially for small programs, the latter is easier, especially if you\\\\u2019re new to event driven programming. Especially when what you\\\\u2019re doing in response may take non-trivial amounts of time. I worked in one fairly unique environment where if a function was going to run for any significant time, you had to either give up on responding to anything else that happened, create an event loop within that function, or create a means of invoking the master event loop in such a way that you\\\\u2019d get control back. Callbacks are so much cleaner than that mess.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"The second reason is that JavaScript is single threaded. This means that most functions that take a non-trivial amount of time should be handled asynchronously. If they weren\\\\u2019t, then those actions would cause JavaScript, if not the entire browser, to become non-responsive until that action completed.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"questionPageImpressionHash\":\"answer_ranking|1396734564\",\"viewerHasAccess\":true,\"feedbackSurveyVariant\":0,\"tribeItem\":null,\"__typename\":\"Answer\",\"viewHash\":\"a-342155796_cdafe13491a99b39e14151958a8b71db\",\"isSelectedForDigestClickthroughSurvey\":false,\"question\":{\"qid\":112547339,\"id\":\"UXVlc3Rpb25AMDoxMTI1NDczMzk=\",\"isDeleted\":false,\"url\":\"/Why-are-callbacks-so-common-in-JavaScript\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"Why are callbacks so common in JavaScript?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"__typename\":\"Question\",\"isPartnerQuestion\":false,\"isTrendyQuestion\":false,\"isFollowUpQuestion\":false,\"asker\":{\"id\":\"VXNlckAwOjE5NTQ0NjEyMg==\",\"__typename\":\"User\",\"isEmployee\":false,\"uid\":195446122},\"slug\":\"Why-are-callbacks-so-common-in-JavaScript\",\"network\":{\"nid\":0,\"id\":\"TmV0d29yazow\"},\"tribeItem\":null,\"answerCount\":2,\"suggestedReplies\":[]},\"permaUrl\":\"/Why-are-callbacks-so-common-in-JavaScript/answer/Eric-Schwertfeger\",\"isVisibleToViewer\":true,\"viewerIsAuthor\":false,\"isShortContent\":false,\"permaUrlOnOriginalQuestion\":\"/Why-are-callbacks-so-common-in-JavaScript/answer/Eric-Schwertfeger\",\"viewerCanRestoreAnswer\":false,\"__isMonetizable\":\"Answer\",\"oid\":342155796,\"contentType\":\"answer\",\"tribe\":null,\"viewer\":{\"consumerBundleSubscription\":null,\"id\":\"Vmlld2VyQDA6MA==\",\"tribeDirectSubscriptions\":[],\"user\":null,\"staticContent\":{\"title\":\"There is help\",\"contentQtextDocument\":{\"legacyJson\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"Need Help? Contact a suicide hotline if you need someone to talk to. If you have a friend in need of help, please encourage that person to contact a suicide hotline as well.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Worldwide\\\\nIn general, if you're outside the US, numbers for your country are here: \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"Help a friend - Befrienders Worldwide\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"http://www.befrienders.org/support/helplines.asp\\\"}}}, {\\\"text\\\": \\\". You can also e-mail \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"jo@samaritans.org\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"mailto:jo@samaritans.org\\\"}}}, {\\\"text\\\": \\\" to talk to someone or visit \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"samaritans.org\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"https://www.samaritans.org/how-we-can-help-you/contact-us\\\"}}}, {\\\"text\\\": \\\" to speak with someone.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"unordered-list\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"United States\\\\nCall the \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"National Suicide Prevention Lifeline\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"https://suicidepreventionlifeline.org/\\\"}}}, {\\\"text\\\": \\\" at 1-800-273-TALK (8255).\\\\nPara espa\\u00f1ol, llame al \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"1-888-628-9454\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"#\\\"}}}, {\\\"text\\\": \\\".\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"unordered-list\\\", \\\"is_rtl\\\": false}]}\",\"id\":\"UXRleHREb2N1bWVudEAwOjkzYzA5ZjNjYjc4MmRkNGEzMWFiMTRmNjhiMWU2YzIz\"},\"staticContentType\":\"suicide_prevention_message\",\"internalUrl\":\"\",\"id\":\"U3RhdGljQ29udGVudEAwOnN1aWNpZGVfcHJldmVudGlvbl9tZXNzYWdl\"}},\"author\":{\"id\":\"VXNlckAwOjE3OTc1MjU1Mg==\",\"uid\":179752552,\"__typename\":\"User\",\"useTranslatedName\":false,\"isMachineAnswerBot\":false,\"names\":[{\"__typename\":\"UserName\",\"id\":\"VXNlck5hbWU6MTc5NzUyNTUyOkxBVE4=\",\"reverseOrder\":false,\"givenName\":\"Eric\",\"familyName\":\"Schwertfeger\",\"scriptCode\":\"LATN\"}],\"adminNames\":[],\"isAnon\":false,\"profileUrl\":\"/profile/Eric-Schwertfeger\",\"smallProfileImageUrl\":\"https://qsf.cf2.quoracdn.net/-4-images.new_grid.profile_default.png-26-688c79556f251aa0.png\",\"profileImageUrl\":\"https://qsf.cf2.quoracdn.net/-4-images.new_grid.profile_default.png-26-688c79556f251aa0.png\",\"isVerified\":false,\"businessStatus\":null,\"consumerBundleActive\":false,\"producerBundleStatus\":\"never_enrolled\",\"viewerHasMuted\":false},\"__isContentObject\":\"Answer\",\"shouldBlurAllImages\":false,\"creationTime\":1646362960064921,\"hasSuicideTopics\":false,\"updatedTime\":0,\"authorTribeUser\":null,\"__isCredentialContainer\":\"Answer\",\"authorCredential\":{\"id\":\"RnJlZUZvcm1DcmVkZW50aWFsQDA6OTM2ODY1MDY=\",\"__typename\":\"FreeFormCredential\",\"__isCredential\":\"FreeFormCredential\",\"translatedString\":\"50+ years as a geek and science enthusiast.\",\"credentialId\":93686506,\"isDefault\":false,\"isBad\":false,\"isEnqueued\":false,\"experience\":\"50+ years as a geek and science enthusiast.\"},\"isTranslated\":false,\"url\":\"/Why-are-callbacks-so-common-in-JavaScript/answer/Eric-Schwertfeger\",\"isOwnTranslation\":false,\"businessCredential\":null,\"businessAnswer\":null,\"credibilityFacts\":[{\"__typename\":\"AuthorInfoFact\",\"id\":\"QXV0aG9ySW5mb0ZhY3RAMDozNDIxNTU3OTY6WzQwNTUsIDI0OTY1NzJd\",\"viewCount\":2496572,\"answerCount\":4055}],\"sourceNetwork\":null,\"sourceQuestion\":null,\"sourceAnswer\":null,\"effectiveAccessOption\":\"free\",\"monetizationIneligibilityReasons\":[],\"notForReproduction\":false,\"numViews\":251,\"__isVotable\":\"Answer\",\"numUpvotes\":3,\"__isQuoraShareable\":\"Answer\",\"numShares\":0,\"moderationCollapseType\":null,\"numRequesters\":0,\"requesters\":[],\"isCommentsDisabled\":false,\"isCollapsedForViewer\":false,\"isModerationLocked\":false,\"moderationCollapseTypeUrl\":null,\"network\":{\"id\":\"TmV0d29yazow\",\"__typename\":\"Network\",\"contentLanguageCode\":\"en\",\"appealsFormUrl\":\"https://help.quora.com/hc/en/requests/new?ticket_form_id=198746\"},\"collapseOperation\":null,\"numDisplayComments\":0,\"__isReportable\":\"Answer\",\"reportableId\":342155796,\"canViewerReport\":false,\"viewerVoteType\":\"novote\"}},\"cursor\":\"29\"},{\"id\":\"UXVlc3Rpb25QYWdlZExpc3RFZGdlOjMw\",\"__typename\":\"QuestionPagedListEdge\",\"node\":{\"id\":\"UXVlc3Rpb25SZWxldmFudEFuc3dlckl0ZW0yQDA6MzIzNTkyNjphbnN3ZXI6MzYwNTA1ODMw\",\"__typename\":\"QuestionRelevantAnswerItem2\",\"__isQuestionPagedListItem\":\"QuestionRelevantAnswerItem2\",\"question\":{\"qid\":3235926,\"id\":\"UXVlc3Rpb25AMDozMjM1OTI2\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"What is a simple explanation of higher order functions and callbacks in JavaScript?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"isQuestionDecanonActive\":true,\"areRelatedAnswersEnabled\":true},\"index\":26,\"isEquivalentAnswer\":false,\"relatedQuestion\":{\"qid\":119201081,\"id\":\"UXVlc3Rpb25AMDoxMTkyMDEwODE=\"},\"answer\":{\"originalQuestionIfDifferent\":null,\"id\":\"QW5zd2VyQDA6MzYwNTA1ODMw\",\"aid\":360505830,\"isDeleted\":false,\"isMachineAnswer\":false,\"content\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"A callback function is a function that is passed as an argument to another function. \\\", \\\"modifiers\\\": {\\\"bold\\\": true}}, {\\\"text\\\": \\\"The function that takes the callback function as an argument is responsible for calling the callback function at some point during its execution. Callback functions are commonly used in event-driven programming, such as when dealing with user input via a button click or keypress.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"For example,\\\", \\\"modifiers\\\": {\\\"bold\\\": true}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"in JavaScript, the syntax for passing a function as an argument to another function would look something like this:\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"function someFunction(callback) {\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" // Do stuff...\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" // And then call the callback function\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" callback();\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"}\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"In the above example, someFunction is responsible for calling the callback function that is passed to it as an argument. The callback function itself could be defined inline, or it could be a separate function that is passed to someFunction.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"A simple callback example\\\", \\\"modifiers\\\": {\\\"bold\\\": true}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Let's say we have a button on a webpage, and we want to execute a certain piece of code when the button is clicked. We can do this by passing a callback function to the button's onclick event handler:\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"In this example, someFunction is a function that is executed when the button is clicked. Inside of someFunction, we have a callback function that is also executed. So, when the button is clicked, both someFunction and callback will be executed.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"A more complex callback example\\\", \\\"modifiers\\\": {\\\"bold\\\": true}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Now let's say we have an array of numbers, and we want to find the largest number in the array. We could do this by passing a callback function to the array's map method:\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"var numbers = [-5, 10, 15];\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"numbers.map(function(number) {\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" return number * 2;\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"});\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"In the above example, we have an array of numbers, and we're using the map method to multiply each number by 2. The map method takes a callback function as an argument, which is used to determine what should be done to each element in the array. In this case, the callback function simply multiplies each number by 2.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"As you can see, callback functions are a powerful way to write code that is easy to read and maintain. They can be used in many different situations, and they provide a great way to modularize your code.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"questionPageImpressionHash\":\"answer_ranking|1931559178\",\"viewerHasAccess\":true,\"feedbackSurveyVariant\":0,\"tribeItem\":null,\"__typename\":\"Answer\",\"viewHash\":\"a-360505830_2dca1c92f907971231c9bbe8e603d32c\",\"isSelectedForDigestClickthroughSurvey\":false,\"question\":{\"qid\":119201081,\"id\":\"UXVlc3Rpb25AMDoxMTkyMDEwODE=\",\"isDeleted\":false,\"url\":\"/In-computer-programming-what-exactly-is-callback-in-simple-terms-and-what-are-some-simple-and-complex-examples-of-it\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"In computer programming, what exactly is \\\\\\\" callback\\\\\\\" in simple terms, and what are some simple and complex examples of it?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"__typename\":\"Question\",\"isPartnerQuestion\":false,\"isTrendyQuestion\":false,\"isFollowUpQuestion\":false,\"asker\":{\"id\":\"VXNlckAwOjc2ODk4MzUy\",\"__typename\":\"User\",\"isEmployee\":false,\"uid\":76898352},\"slug\":\"In-computer-programming-what-exactly-is-callback-in-simple-terms-and-what-are-some-simple-and-complex-examples-of-it\",\"network\":{\"nid\":0,\"id\":\"TmV0d29yazow\"},\"tribeItem\":null,\"answerCount\":2,\"suggestedReplies\":[]},\"permaUrl\":\"/In-computer-programming-what-exactly-is-callback-in-simple-terms-and-what-are-some-simple-and-complex-examples-of-it/answer/Andrew-Kim-60\",\"isVisibleToViewer\":true,\"viewerIsAuthor\":false,\"isShortContent\":false,\"permaUrlOnOriginalQuestion\":\"/In-computer-programming-what-exactly-is-callback-in-simple-terms-and-what-are-some-simple-and-complex-examples-of-it/answer/Andrew-Kim-60\",\"viewerCanRestoreAnswer\":false,\"__isMonetizable\":\"Answer\",\"oid\":360505830,\"contentType\":\"answer\",\"tribe\":null,\"viewer\":{\"consumerBundleSubscription\":null,\"id\":\"Vmlld2VyQDA6MA==\",\"tribeDirectSubscriptions\":[],\"user\":null,\"staticContent\":{\"title\":\"There is help\",\"contentQtextDocument\":{\"legacyJson\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"Need Help? Contact a suicide hotline if you need someone to talk to. If you have a friend in need of help, please encourage that person to contact a suicide hotline as well.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Worldwide\\\\nIn general, if you're outside the US, numbers for your country are here: \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"Help a friend - Befrienders Worldwide\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"http://www.befrienders.org/support/helplines.asp\\\"}}}, {\\\"text\\\": \\\". You can also e-mail \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"jo@samaritans.org\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"mailto:jo@samaritans.org\\\"}}}, {\\\"text\\\": \\\" to talk to someone or visit \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"samaritans.org\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"https://www.samaritans.org/how-we-can-help-you/contact-us\\\"}}}, {\\\"text\\\": \\\" to speak with someone.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"unordered-list\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"United States\\\\nCall the \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"National Suicide Prevention Lifeline\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"https://suicidepreventionlifeline.org/\\\"}}}, {\\\"text\\\": \\\" at 1-800-273-TALK (8255).\\\\nPara espa\\u00f1ol, llame al \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"1-888-628-9454\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"#\\\"}}}, {\\\"text\\\": \\\".\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"unordered-list\\\", \\\"is_rtl\\\": false}]}\",\"id\":\"UXRleHREb2N1bWVudEAwOjkzYzA5ZjNjYjc4MmRkNGEzMWFiMTRmNjhiMWU2YzIz\"},\"staticContentType\":\"suicide_prevention_message\",\"internalUrl\":\"\",\"id\":\"U3RhdGljQ29udGVudEAwOnN1aWNpZGVfcHJldmVudGlvbl9tZXNzYWdl\"}},\"author\":{\"id\":\"VXNlckAwOjMxOTgwODIy\",\"uid\":31980822,\"__typename\":\"User\",\"useTranslatedName\":false,\"isMachineAnswerBot\":false,\"names\":[{\"__typename\":\"UserName\",\"id\":\"VXNlck5hbWU6MzE5ODA4MjI6TEFUTg==\",\"reverseOrder\":false,\"givenName\":\"Andrew\",\"familyName\":\"Kim\",\"scriptCode\":\"LATN\"}],\"adminNames\":[],\"isAnon\":false,\"profileUrl\":\"/profile/Andrew-Kim-60\",\"smallProfileImageUrl\":\"https://qph.cf2.quoracdn.net/main-thumb-31980822-50-hkbjueisvmfnhwoifkxpldjioatlrovn.jpeg\",\"profileImageUrl\":\"https://qph.cf2.quoracdn.net/main-thumb-31980822-200-hkbjueisvmfnhwoifkxpldjioatlrovn.jpeg\",\"isVerified\":false,\"businessStatus\":null,\"consumerBundleActive\":false,\"producerBundleStatus\":\"never_enrolled\",\"viewerHasMuted\":false},\"__isContentObject\":\"Answer\",\"shouldBlurAllImages\":false,\"creationTime\":1654613246556351,\"hasSuicideTopics\":false,\"updatedTime\":0,\"authorTribeUser\":null,\"__isCredentialContainer\":\"Answer\",\"authorCredential\":{\"id\":\"RnJlZUZvcm1DcmVkZW50aWFsQDA6MTI0NDQ0MDYy\",\"__typename\":\"FreeFormCredential\",\"__isCredential\":\"FreeFormCredential\",\"translatedString\":\"Founding Engineer\",\"credentialId\":124444062,\"isDefault\":false,\"isBad\":false,\"isEnqueued\":false,\"experience\":\"Founding Engineer\"},\"isTranslated\":false,\"url\":\"/In-computer-programming-what-exactly-is-callback-in-simple-terms-and-what-are-some-simple-and-complex-examples-of-it/answer/Andrew-Kim-60\",\"isOwnTranslation\":false,\"businessCredential\":null,\"businessAnswer\":null,\"credibilityFacts\":[{\"__typename\":\"AuthorInfoFact\",\"id\":\"QXV0aG9ySW5mb0ZhY3RAMDozNjA1MDU4MzA6Wzg1LCA3OTU0NV0=\",\"viewCount\":79545,\"answerCount\":85}],\"sourceNetwork\":null,\"sourceQuestion\":null,\"sourceAnswer\":null,\"effectiveAccessOption\":\"free\",\"monetizationIneligibilityReasons\":[],\"notForReproduction\":false,\"numViews\":591,\"__isVotable\":\"Answer\",\"numUpvotes\":1,\"__isQuoraShareable\":\"Answer\",\"numShares\":0,\"moderationCollapseType\":null,\"numRequesters\":0,\"requesters\":[],\"isCommentsDisabled\":false,\"isCollapsedForViewer\":false,\"isModerationLocked\":false,\"moderationCollapseTypeUrl\":null,\"network\":{\"id\":\"TmV0d29yazow\",\"__typename\":\"Network\",\"contentLanguageCode\":\"en\",\"appealsFormUrl\":\"https://help.quora.com/hc/en/requests/new?ticket_form_id=198746\"},\"collapseOperation\":null,\"numDisplayComments\":0,\"__isReportable\":\"Answer\",\"reportableId\":360505830,\"canViewerReport\":false,\"viewerVoteType\":\"novote\"}},\"cursor\":\"30\"},{\"id\":\"UXVlc3Rpb25QYWdlZExpc3RFZGdlOjMx\",\"__typename\":\"QuestionPagedListEdge\",\"node\":{\"id\":\"UXVlc3Rpb25SZWxldmFudEFuc3dlckl0ZW0yQDA6MzIzNTkyNjphbnN3ZXI6MzkwOTk4Mjg2\",\"__typename\":\"QuestionRelevantAnswerItem2\",\"__isQuestionPagedListItem\":\"QuestionRelevantAnswerItem2\",\"question\":{\"qid\":3235926,\"id\":\"UXVlc3Rpb25AMDozMjM1OTI2\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"What is a simple explanation of higher order functions and callbacks in JavaScript?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"isQuestionDecanonActive\":true,\"areRelatedAnswersEnabled\":true},\"index\":27,\"isEquivalentAnswer\":false,\"relatedQuestion\":{\"qid\":4148246,\"id\":\"UXVlc3Rpb25AMDo0MTQ4MjQ2\"},\"answer\":{\"originalQuestionIfDifferent\":null,\"id\":\"QW5zd2VyQDA6MzkwOTk4Mjg2\",\"aid\":390998286,\"isDeleted\":false,\"isMachineAnswer\":false,\"content\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"\\\", \\\"modifiers\\\": {\\\"image\\\": \\\"https://qph.cf2.quoracdn.net/main-qimg-f3a8dd28faa4a0dc4e0a9eb06f289bfb-pjlq\\\", \\\"height\\\": 368, \\\"width\\\": 700, \\\"master_url\\\": \\\"https://qph.cf2.quoracdn.net/main-qimg-6f0b27d98596b3501562880c2e3458f5\\\", \\\"is_deleted\\\": false, \\\"is_sensitive\\\": false, \\\"is_uploaded_by_bot\\\": false, \\\"zoomable\\\": true, \\\"dominant_color\\\": \\\"#f8db3c\\\"}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"image\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Functions are first-class citizens in JavaScript. As a result, you can provide a function as an argument to another function.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"A callback is a function passed into another function as a parameter to be executed later by definition.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"The function filter() is described as follows, which takes an array of numbers as input and outputs a new array of odd numbers:\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"function filter(numbers) {\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" let results = [];\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" for (const number of numbers) {\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" if (number % 2 != 0) {\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" results.push(number);\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" }\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" }\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" return results;\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"}\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"let numbers = [1, 2, 4, 7, 3, 5, 6];\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"console.log(filter(numbers));\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"How it operates.\\\", \\\"modifiers\\\": {\\\"bold\\\": true}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"The filter() function, which accepts an array of integers and returns a new array containing the odd numbers, should first be defined.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Next, specify the array of integers containing odd and even numbers.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Third, use the filter() function to print the odd numbers extracted from the numbers array.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"You must alter the filter() function if you wish to produce an array of even numbers. The filter() function can be made more reusable and general by:\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"First, isolate the if block's logic and put it within a different function.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Second, pass the function as a parameter to the filter() function.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Here's the updated code:\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"function isOdd(number) {\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" return number % 2 != 0;\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"}\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"function filter(numbers, fn) {\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" let results = [];\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" for (const number of numbers) {\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" if (fn(number)) {\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" results.push(number);\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" }\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" }\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" return results;\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"}\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"let numbers = [1, 2, 4, 7, 3, 5, 6];\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"console.log(filter(numbers, isOdd));\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"The outcome is identical. The second argument of the filter() method, however, can be any function that takes an argument and returns a boolean value.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"For instance, you can return an array of even numbers using the filter() function as shown here:\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"function isOdd(number) {\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" return number % 2 != 0;\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"}\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"function isEven(number) {\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" return number % 2 == 0;\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"}\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"function filter(numbers, fn) {\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" let results = [];\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" for (const number of numbers) {\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" if (fn(number)) {\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" results.push(number);\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" }\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" }\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" return results;\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"}\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"let numbers = [1, 2, 4, 7, 3, 5, 6];\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"console.log(filter(numbers, isOdd));\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"console.log(filter(numbers, isEven));\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"A high-order function takes a function as an input.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"An anonymous function, or a function without a name, can be a callback.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"function filter(numbers, callback) {\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" let results = [];\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" for (const number of numbers) {\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" if (callback(number)) {\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" results.push(number);\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" }\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" }\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" return results;\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"}\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"let numbers = [1, 2, 4, 7, 3, 5, 6];\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"let oddNumbers = filter(numbers, function (number) {\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" return number % 2 != 0;\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"});\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"console.log(oddNumbers);\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"A distinct function is not used; instead, an anonymous function is passed to the filter() method.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Use the following arrow function in ES6:\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"function filter(numbers, callback) {\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" let results = [];\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" for (const number of numbers) {\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" if (callback(number)) {\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" results.push(number);\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" }\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" }\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" return results;\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"}\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"let numbers = [1, 2, 4, 7, 3, 5, 6];\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"let oddNumbers = filter(numbers, (number) => number % 2 != 0);\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"console.log(oddNumbers);\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Asynchronous and synchronous callbacks are the two different forms of callbacks.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Synchronous callbacks\\\", \\\"modifiers\\\": {\\\"bold\\\": true}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"The high-order function that uses the callback executes synchronously while using the callback. As they run concurrently with the filter() function, the synchronous callbacks isOdd and isEven are examples of this.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Asynchronous callbacks\\\", \\\"modifiers\\\": {\\\"bold\\\": true}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Following the high-order function that uses the callback, an asynchronous callback is executed.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Asynchronicity means that JavaScript will run the remaining code while it waits for an operation to finish.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"JavaScript is a single-threaded programming language, so keep that in mind. It carries out asynchronous actions via an event loop and callback queue.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Let's say you need to create a script that processes a photo once it has been downloaded from a distant server:\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"function download(URL) {\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" // ...\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"}\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"function process(picture) {\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" // ...\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"}\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"download(url);\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"process(picture);\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"However, depending on the network speed and the photo size, downloading a picture from a distant server takes some time.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"The following download() method simulates a network request using the setTimeout() function.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"function download(URL) {\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" setTimeout(() => {\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" // script to download the picture here\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" console.log(`Downloading ${url} ...`);\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" },1000);\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"}\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"And the process() function is simulated by this code:\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"function process(picture) {\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" console.log(`Processing ${picture}`);\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"}\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"When the code above is run:\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"let URL = 'https://www.quora.net/pic.jpg';\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"download(URL);\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"process(URL);\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"You will get the following output:\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Processing https://quora.net/pic.jpg\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Downloading https://quora.net/pic.jpg ...\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"This is not what you expected because the process() function executes before the download() function. The correct sequence should be:\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Download the picture and wait for the download completes.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Process the picture.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"To resolve this issue, you can pass the process() function to the download() function and execute the process() function inside the download() function once the download completes, like this:\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"function download(URL, callback) {\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" setTimeout(() => {\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" // script to download the picture here\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" console.log(`Downloading ${url} ...`);\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" // process the picture once it is completed\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" callback(URL);\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" }, 1000);\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"}\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"function process(picture) {\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" console.log(`Processing ${picture}`);\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"}\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"let URL = 'https://www.quora.net/pic.jpg';\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"download(URL, process);\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Output:\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Downloading https://www.quora.net/pic.jpg ...\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Processing https://www.quora.net/pic.jpg\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"It functions as intended now.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"In this illustration, the callback supplied into the asynchronous method is called process().\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Asynchronous callbacks are used to carry on code execution after an asynchronous operation.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"You can declare the process() function as an anonymous function to keep the code shorter:\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"function download(URL, callback) {\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" setTimeout(() => {\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" // script to download the picture here\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" console.log(`Downloading ${url} ...`);\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" // process the picture once it is completed\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" callback(URL);\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" }, 1000);\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"}\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"let url = 'https://www.quora.net/pic.jpg';\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"download(url, function(picture) {\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" console.log(`Processing ${picture}`);\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"});\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}]}\",\"questionPageImpressionHash\":\"answer_ranking|-1826862380\",\"viewerHasAccess\":true,\"feedbackSurveyVariant\":0,\"tribeItem\":null,\"__typename\":\"Answer\",\"viewHash\":\"a-390998286_61eff94e2ddee839d4299d09514669f1\",\"isSelectedForDigestClickthroughSurvey\":false,\"question\":{\"qid\":4148246,\"id\":\"UXVlc3Rpb25AMDo0MTQ4MjQ2\",\"isDeleted\":false,\"url\":\"/How-does-the-Javascript-callback-function-work\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"How does the Javascript callback function work?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"__typename\":\"Question\",\"isPartnerQuestion\":false,\"isTrendyQuestion\":false,\"isFollowUpQuestion\":false,\"asker\":{\"id\":\"VXNlckAwOjI2NjQ1NDEy\",\"__typename\":\"User\",\"isEmployee\":false,\"uid\":26645412},\"slug\":\"How-does-the-Javascript-callback-function-work\",\"network\":{\"nid\":0,\"id\":\"TmV0d29yazow\"},\"tribeItem\":null,\"answerCount\":9,\"suggestedReplies\":[\"Can you explain the difference between callbacks and promises?\",\"What are some common use cases for callback functions?\",\"How do I handle multiple callbacks in JavaScript?\"]},\"permaUrl\":\"/How-does-the-Javascript-callback-function-work/answer/Divyanshu-Dixit-51\",\"isVisibleToViewer\":true,\"viewerIsAuthor\":false,\"isShortContent\":false,\"permaUrlOnOriginalQuestion\":\"/How-does-the-Javascript-callback-function-work/answer/Divyanshu-Dixit-51\",\"viewerCanRestoreAnswer\":false,\"__isMonetizable\":\"Answer\",\"oid\":390998286,\"contentType\":\"answer\",\"tribe\":null,\"viewer\":{\"consumerBundleSubscription\":null,\"id\":\"Vmlld2VyQDA6MA==\",\"tribeDirectSubscriptions\":[],\"user\":null,\"staticContent\":{\"title\":\"There is help\",\"contentQtextDocument\":{\"legacyJson\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"Need Help? Contact a suicide hotline if you need someone to talk to. If you have a friend in need of help, please encourage that person to contact a suicide hotline as well.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Worldwide\\\\nIn general, if you're outside the US, numbers for your country are here: \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"Help a friend - Befrienders Worldwide\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"http://www.befrienders.org/support/helplines.asp\\\"}}}, {\\\"text\\\": \\\". You can also e-mail \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"jo@samaritans.org\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"mailto:jo@samaritans.org\\\"}}}, {\\\"text\\\": \\\" to talk to someone or visit \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"samaritans.org\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"https://www.samaritans.org/how-we-can-help-you/contact-us\\\"}}}, {\\\"text\\\": \\\" to speak with someone.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"unordered-list\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"United States\\\\nCall the \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"National Suicide Prevention Lifeline\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"https://suicidepreventionlifeline.org/\\\"}}}, {\\\"text\\\": \\\" at 1-800-273-TALK (8255).\\\\nPara espa\\u00f1ol, llame al \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"1-888-628-9454\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"#\\\"}}}, {\\\"text\\\": \\\".\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"unordered-list\\\", \\\"is_rtl\\\": false}]}\",\"id\":\"UXRleHREb2N1bWVudEAwOjkzYzA5ZjNjYjc4MmRkNGEzMWFiMTRmNjhiMWU2YzIz\"},\"staticContentType\":\"suicide_prevention_message\",\"internalUrl\":\"\",\"id\":\"U3RhdGljQ29udGVudEAwOnN1aWNpZGVfcHJldmVudGlvbl9tZXNzYWdl\"}},\"author\":{\"id\":\"VXNlckAwOjE4ODE3Mjk4ODE=\",\"uid\":1881729881,\"__typename\":\"User\",\"useTranslatedName\":false,\"isMachineAnswerBot\":false,\"names\":[{\"__typename\":\"UserName\",\"id\":\"VXNlck5hbWU6MTg4MTcyOTg4MTpMQVRO\",\"reverseOrder\":false,\"givenName\":\"Divyanshu Dixit\",\"familyName\":\"\",\"scriptCode\":\"LATN\"}],\"adminNames\":[],\"isAnon\":false,\"profileUrl\":\"/profile/Divyanshu-Dixit-51\",\"smallProfileImageUrl\":\"https://qsf.cf2.quoracdn.net/-4-images.new_grid.profile_default.png-26-688c79556f251aa0.png\",\"profileImageUrl\":\"https://qsf.cf2.quoracdn.net/-4-images.new_grid.profile_default.png-26-688c79556f251aa0.png\",\"isVerified\":false,\"businessStatus\":null,\"consumerBundleActive\":false,\"producerBundleStatus\":\"never_enrolled\",\"viewerHasMuted\":false},\"__isContentObject\":\"Answer\",\"shouldBlurAllImages\":false,\"creationTime\":1665558127009267,\"hasSuicideTopics\":false,\"updatedTime\":0,\"authorTribeUser\":null,\"__isCredentialContainer\":\"Answer\",\"authorCredential\":{\"id\":\"TGlmZUV4cGVyaWVuY2VDcmVkZW50aWFsQDA6MTU0MTk4MTk1\",\"__typename\":\"LifeExperienceCredential\",\"__isCredential\":\"LifeExperienceCredential\",\"translatedString\":\"learning Full Stack Development\",\"experience\":{\"id\":\"VG9waWNAMDo5NDU=\",\"__typename\":\"Topic\",\"tid\":945,\"name\":\"JavaScript (programming language)\"},\"description\":\"learning Full Stack Development\",\"isDefault\":false,\"isBad\":false,\"isEnqueued\":false,\"credentialId\":154198195},\"isTranslated\":false,\"url\":\"/How-does-the-Javascript-callback-function-work/answer/Divyanshu-Dixit-51\",\"isOwnTranslation\":false,\"businessCredential\":null,\"businessAnswer\":null,\"credibilityFacts\":[{\"__typename\":\"AuthorInfoFact\",\"id\":\"QXV0aG9ySW5mb0ZhY3RAMDozOTA5OTgyODY6WzU3MywgNTE0NDE0XQ==\",\"viewCount\":514414,\"answerCount\":573}],\"sourceNetwork\":null,\"sourceQuestion\":null,\"sourceAnswer\":null,\"effectiveAccessOption\":\"free\",\"monetizationIneligibilityReasons\":[],\"notForReproduction\":false,\"numViews\":483,\"__isVotable\":\"Answer\",\"numUpvotes\":4,\"__isQuoraShareable\":\"Answer\",\"numShares\":0,\"moderationCollapseType\":null,\"numRequesters\":0,\"requesters\":[],\"isCommentsDisabled\":false,\"isCollapsedForViewer\":false,\"isModerationLocked\":false,\"moderationCollapseTypeUrl\":null,\"network\":{\"id\":\"TmV0d29yazow\",\"__typename\":\"Network\",\"contentLanguageCode\":\"en\",\"appealsFormUrl\":\"https://help.quora.com/hc/en/requests/new?ticket_form_id=198746\"},\"collapseOperation\":null,\"numDisplayComments\":0,\"__isReportable\":\"Answer\",\"reportableId\":390998286,\"canViewerReport\":false,\"viewerVoteType\":\"novote\"}},\"cursor\":\"31\"},{\"id\":\"UXVlc3Rpb25QYWdlZExpc3RFZGdlOjMy\",\"__typename\":\"QuestionPagedListEdge\",\"node\":{\"id\":\"UXVlc3Rpb25SZWxldmFudEFuc3dlckl0ZW0yQDA6MzIzNTkyNjphbnN3ZXI6MTA3OTA2ODIy\",\"__typename\":\"QuestionRelevantAnswerItem2\",\"__isQuestionPagedListItem\":\"QuestionRelevantAnswerItem2\",\"question\":{\"qid\":3235926,\"id\":\"UXVlc3Rpb25AMDozMjM1OTI2\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"What is a simple explanation of higher order functions and callbacks in JavaScript?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"isQuestionDecanonActive\":true,\"areRelatedAnswersEnabled\":true},\"index\":28,\"isEquivalentAnswer\":false,\"relatedQuestion\":{\"qid\":37314775,\"id\":\"UXVlc3Rpb25AMDozNzMxNDc3NQ==\"},\"answer\":{\"originalQuestionIfDifferent\":null,\"id\":\"QW5zd2VyQDA6MTA3OTA2ODIy\",\"aid\":107906822,\"isDeleted\":false,\"isMachineAnswer\":false,\"content\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"In fun programming languages, functions can be passed around as values, including inside of another function\\\\u2019s parameter/argument list. Some of these function arguments might be used as callback functions. This makes it possible to program using higher order functions.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"How a language handles function return statements or if it just returns the last expression has no relation to it supporting higher order functions. Most functional languages prefer to implicitly return the last expression before exiting the function body, Javascript has an explicit return statement - similar to C-inspired languages.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"questionPageImpressionHash\":\"answer_ranking|-1984694203\",\"viewerHasAccess\":true,\"feedbackSurveyVariant\":0,\"tribeItem\":null,\"__typename\":\"Answer\",\"viewHash\":\"a-107906822_24a1a950bf2d92f2dffadebf18b33420\",\"isSelectedForDigestClickthroughSurvey\":false,\"question\":{\"qid\":37314775,\"id\":\"UXVlc3Rpb25AMDozNzMxNDc3NQ==\",\"isDeleted\":false,\"url\":\"/In-JavaScript-whats-the-deal-with-a-function-argument-instead-of-a-return-statement-so-called-callbacks\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"In JavaScript, what's the deal with a function argument instead of a return statement, so-called callbacks?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"__typename\":\"Question\",\"isPartnerQuestion\":false,\"isTrendyQuestion\":false,\"isFollowUpQuestion\":false,\"asker\":{\"id\":\"VXNlckAwOjI5MTYyNzc1Nw==\",\"__typename\":\"User\",\"isEmployee\":false,\"uid\":291627757},\"slug\":\"In-JavaScript-whats-the-deal-with-a-function-argument-instead-of-a-return-statement-so-called-callbacks\",\"network\":{\"nid\":0,\"id\":\"TmV0d29yazow\"},\"tribeItem\":null,\"answerCount\":1,\"suggestedReplies\":[]},\"permaUrl\":\"/In-JavaScript-whats-the-deal-with-a-function-argument-instead-of-a-return-statement-so-called-callbacks/answer/Paul-Spades-1\",\"isVisibleToViewer\":true,\"viewerIsAuthor\":false,\"isShortContent\":false,\"permaUrlOnOriginalQuestion\":\"/In-JavaScript-whats-the-deal-with-a-function-argument-instead-of-a-return-statement-so-called-callbacks/answer/Paul-Spades-1\",\"viewerCanRestoreAnswer\":false,\"__isMonetizable\":\"Answer\",\"oid\":107906822,\"contentType\":\"answer\",\"tribe\":null,\"viewer\":{\"consumerBundleSubscription\":null,\"id\":\"Vmlld2VyQDA6MA==\",\"tribeDirectSubscriptions\":[],\"user\":null,\"staticContent\":{\"title\":\"There is help\",\"contentQtextDocument\":{\"legacyJson\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"Need Help? Contact a suicide hotline if you need someone to talk to. If you have a friend in need of help, please encourage that person to contact a suicide hotline as well.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Worldwide\\\\nIn general, if you're outside the US, numbers for your country are here: \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"Help a friend - Befrienders Worldwide\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"http://www.befrienders.org/support/helplines.asp\\\"}}}, {\\\"text\\\": \\\". You can also e-mail \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"jo@samaritans.org\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"mailto:jo@samaritans.org\\\"}}}, {\\\"text\\\": \\\" to talk to someone or visit \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"samaritans.org\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"https://www.samaritans.org/how-we-can-help-you/contact-us\\\"}}}, {\\\"text\\\": \\\" to speak with someone.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"unordered-list\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"United States\\\\nCall the \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"National Suicide Prevention Lifeline\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"https://suicidepreventionlifeline.org/\\\"}}}, {\\\"text\\\": \\\" at 1-800-273-TALK (8255).\\\\nPara espa\\u00f1ol, llame al \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"1-888-628-9454\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"#\\\"}}}, {\\\"text\\\": \\\".\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"unordered-list\\\", \\\"is_rtl\\\": false}]}\",\"id\":\"UXRleHREb2N1bWVudEAwOjkzYzA5ZjNjYjc4MmRkNGEzMWFiMTRmNjhiMWU2YzIz\"},\"staticContentType\":\"suicide_prevention_message\",\"internalUrl\":\"\",\"id\":\"U3RhdGljQ29udGVudEAwOnN1aWNpZGVfcHJldmVudGlvbl9tZXNzYWdl\"}},\"author\":{\"id\":\"VXNlckAwOjY3MDg5NTQ0\",\"uid\":67089544,\"__typename\":\"User\",\"useTranslatedName\":false,\"isMachineAnswerBot\":false,\"names\":[{\"__typename\":\"UserName\",\"id\":\"VXNlck5hbWU6NjcwODk1NDQ6TEFUTg==\",\"reverseOrder\":false,\"givenName\":\"Paul\",\"familyName\":\"Spades\",\"scriptCode\":\"LATN\"}],\"adminNames\":[],\"isAnon\":false,\"profileUrl\":\"/profile/Paul-Spades-1\",\"smallProfileImageUrl\":\"https://qph.cf2.quoracdn.net/main-thumb-67089544-50-prpjdqnyoqmcdroqxhwboaejndljwuwo.jpeg\",\"profileImageUrl\":\"https://qph.cf2.quoracdn.net/main-thumb-67089544-200-prpjdqnyoqmcdroqxhwboaejndljwuwo.jpeg\",\"isVerified\":false,\"businessStatus\":null,\"consumerBundleActive\":false,\"producerBundleStatus\":\"never_enrolled\",\"viewerHasMuted\":false},\"__isContentObject\":\"Answer\",\"shouldBlurAllImages\":false,\"creationTime\":1542129734400852,\"hasSuicideTopics\":false,\"updatedTime\":1542129794011965,\"authorTribeUser\":null,\"__isCredentialContainer\":\"Answer\",\"authorCredential\":{\"id\":\"TGlmZUV4cGVyaWVuY2VDcmVkZW50aWFsQDA6MzI0MzAxNDY=\",\"__typename\":\"LifeExperienceCredential\",\"__isCredential\":\"LifeExperienceCredential\",\"translatedString\":\"writes simple, small functions and actually likes DOM Level 0.\",\"experience\":{\"id\":\"VG9waWNAMDo5NDU=\",\"__typename\":\"Topic\",\"tid\":945,\"name\":\"JavaScript (programming language)\"},\"description\":\"writes simple, small functions and actually likes DOM Level 0.\",\"isDefault\":false,\"isBad\":false,\"isEnqueued\":false,\"credentialId\":32430146},\"isTranslated\":false,\"url\":\"/In-JavaScript-whats-the-deal-with-a-function-argument-instead-of-a-return-statement-so-called-callbacks/answer/Paul-Spades-1\",\"isOwnTranslation\":false,\"businessCredential\":null,\"businessAnswer\":null,\"credibilityFacts\":[{\"__typename\":\"AuthorInfoFact\",\"id\":\"QXV0aG9ySW5mb0ZhY3RAMDoxMDc5MDY4MjI6WzI0OSwgMzIxNjQ0XQ==\",\"viewCount\":321644,\"answerCount\":249}],\"sourceNetwork\":null,\"sourceQuestion\":null,\"sourceAnswer\":null,\"effectiveAccessOption\":\"free\",\"monetizationIneligibilityReasons\":[],\"notForReproduction\":false,\"numViews\":211,\"__isVotable\":\"Answer\",\"numUpvotes\":1,\"__isQuoraShareable\":\"Answer\",\"numShares\":0,\"moderationCollapseType\":null,\"numRequesters\":0,\"requesters\":[],\"isCommentsDisabled\":false,\"isCollapsedForViewer\":false,\"isModerationLocked\":false,\"moderationCollapseTypeUrl\":null,\"network\":{\"id\":\"TmV0d29yazow\",\"__typename\":\"Network\",\"contentLanguageCode\":\"en\",\"appealsFormUrl\":\"https://help.quora.com/hc/en/requests/new?ticket_form_id=198746\"},\"collapseOperation\":null,\"numDisplayComments\":0,\"__isReportable\":\"Answer\",\"reportableId\":107906822,\"canViewerReport\":false,\"viewerVoteType\":\"novote\"}},\"cursor\":\"32\"},{\"id\":\"UXVlc3Rpb25QYWdlZExpc3RFZGdlOjMz\",\"__typename\":\"QuestionPagedListEdge\",\"node\":{\"id\":\"UXVlc3Rpb25SZWxldmFudEFuc3dlckl0ZW0yQDA6MzIzNTkyNjphbnN3ZXI6MTA1MTE1NDU4\",\"__typename\":\"QuestionRelevantAnswerItem2\",\"__isQuestionPagedListItem\":\"QuestionRelevantAnswerItem2\",\"question\":{\"qid\":3235926,\"id\":\"UXVlc3Rpb25AMDozMjM1OTI2\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"What is a simple explanation of higher order functions and callbacks in JavaScript?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"isQuestionDecanonActive\":true,\"areRelatedAnswersEnabled\":true},\"index\":29,\"isEquivalentAnswer\":false,\"relatedQuestion\":{\"qid\":7558025,\"id\":\"UXVlc3Rpb25AMDo3NTU4MDI1\"},\"answer\":{\"originalQuestionIfDifferent\":{\"question\":{\"qid\":36352932,\"id\":\"UXVlc3Rpb25AMDozNjM1MjkzMg==\",\"url\":\"/What-is-the-callback-in-JavaScript-Why-do-we-use-it\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"What is the callback in JavaScript? Why do we use it?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"__typename\":\"Question\",\"isPartnerQuestion\":false,\"isTrendyQuestion\":false,\"isFollowUpQuestion\":false,\"asker\":{\"id\":\"VXNlckAwOjE2OTU5MzUxNQ==\",\"__typename\":\"User\",\"isEmployee\":false,\"uid\":169593515},\"slug\":\"What-is-the-callback-in-JavaScript-Why-do-we-use-it\",\"network\":{\"nid\":0,\"id\":\"TmV0d29yazow\"},\"tribeItem\":null,\"debugInfo\":\"{}\",\"viewer\":{\"user\":null,\"id\":\"Vmlld2VyQDA6MA==\"}},\"id\":\"T3JpZ2luYWxseUFuc3dlcmVkUXVlc3Rpb25AMDoxMDUxMTU0NTg6MzYzNTI5MzI=\",\"originalQuestionText\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"What is the callback in JavaScript? Why do we use it?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"isQuestionBannerRemoved\":false},\"id\":\"QW5zd2VyQDA6MTA1MTE1NDU4\",\"aid\":105115458,\"isDeleted\":false,\"isMachineAnswer\":false,\"content\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"Callback in general is as good as any other function. However it provides you with a scope of deferred execution, or a way to execute code at a future time. Or in a more generalizing way, execute a function after execution of a different function.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"With regards to Javascript, callbacks are one of its amazing features because of functions being a first class citizen. You can pass around functions like objects or variables.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"For example :\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"var callback = function callback(arg1, arg2)\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"{\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"\\\\t// some operations that happen\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"};\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"// Here you just passed a function as a parameter, same how you pass objects\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"function fn(callback)\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"{\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"\\\\tvar a = 10;\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"\\\\tvar b = 20;\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"\\\\tif(someCondition)\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"\\\\t\\\\tcallback(a,b);\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"}\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"If you notice that you already had an implementation or a response to a certain situation which happened in the fn() function, you just invoked the response.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"So as because JS provides functions as first class objects, you can have an implementation and pass it around as parameters and execute them based on a requirement.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Coming to the 2nd part of your question, as because Javascript is a single threaded language, (or exposes a single thread to the user to operate), to not allow blocking of the user, it provides asynchronicity for responsiveness.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"To implement the asynchronous nature, where execution happens only when certain \\\\u201csituations\\\\u201d (read: events) occur, it employs the concept of callbacks, where the implementation or the response to the event is written, happens only when the event occurs.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Hence you will see that Browser/DOM events have callbacks, Network calls (Ajax requests. WebSocket requests) have callbacks attached on events, If you bring Node.js into perspective, File I/O has callback, DB connections, Socket Operations all have callbacks which only execute when certain events occur.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"To implement async behavior in a single threaded language so as to maintain responsiveness, we employ the use of callbacks.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Hope this helps!!\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"questionPageImpressionHash\":\"answer_ranking|-677328595\",\"viewerHasAccess\":true,\"feedbackSurveyVariant\":0,\"tribeItem\":null,\"__typename\":\"Answer\",\"viewHash\":\"a-105115458_73596c68aea098d71fc5ac9800a300f6\",\"isSelectedForDigestClickthroughSurvey\":false,\"question\":{\"qid\":7558025,\"id\":\"UXVlc3Rpb25AMDo3NTU4MDI1\",\"isDeleted\":false,\"url\":\"/What-is-callback-in-javascript\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"What is callback in javascript?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"__typename\":\"Question\",\"isPartnerQuestion\":false,\"isTrendyQuestion\":false,\"isFollowUpQuestion\":false,\"asker\":{\"id\":\"VXNlckAwOjEyMTM5NDk0MQ==\",\"__typename\":\"User\",\"isEmployee\":false,\"uid\":121394941},\"slug\":\"What-is-callback-in-javascript\",\"network\":{\"nid\":0,\"id\":\"TmV0d29yazow\"},\"tribeItem\":null,\"answerCount\":16,\"suggestedReplies\":[\"Can you explain how Promises improve upon callbacks?\",\"What are the downsides of using callbacks in JavaScript?\",\"How does async/await work in relation to callbacks?\"]},\"permaUrl\":\"/What-is-callback-in-javascript/answers/105115458\",\"isVisibleToViewer\":true,\"viewerIsAuthor\":false,\"isShortContent\":false,\"permaUrlOnOriginalQuestion\":\"/What-is-the-callback-in-JavaScript-Why-do-we-use-it/answers/105115458?no_redirect=1\",\"viewerCanRestoreAnswer\":false,\"__isMonetizable\":\"Answer\",\"oid\":105115458,\"contentType\":\"answer\",\"tribe\":null,\"viewer\":{\"consumerBundleSubscription\":null,\"id\":\"Vmlld2VyQDA6MA==\",\"tribeDirectSubscriptions\":[],\"user\":null,\"staticContent\":{\"title\":\"There is help\",\"contentQtextDocument\":{\"legacyJson\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"Need Help? Contact a suicide hotline if you need someone to talk to. If you have a friend in need of help, please encourage that person to contact a suicide hotline as well.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Worldwide\\\\nIn general, if you're outside the US, numbers for your country are here: \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"Help a friend - Befrienders Worldwide\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"http://www.befrienders.org/support/helplines.asp\\\"}}}, {\\\"text\\\": \\\". You can also e-mail \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"jo@samaritans.org\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"mailto:jo@samaritans.org\\\"}}}, {\\\"text\\\": \\\" to talk to someone or visit \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"samaritans.org\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"https://www.samaritans.org/how-we-can-help-you/contact-us\\\"}}}, {\\\"text\\\": \\\" to speak with someone.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"unordered-list\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"United States\\\\nCall the \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"National Suicide Prevention Lifeline\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"https://suicidepreventionlifeline.org/\\\"}}}, {\\\"text\\\": \\\" at 1-800-273-TALK (8255).\\\\nPara espa\\u00f1ol, llame al \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"1-888-628-9454\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"#\\\"}}}, {\\\"text\\\": \\\".\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"unordered-list\\\", \\\"is_rtl\\\": false}]}\",\"id\":\"UXRleHREb2N1bWVudEAwOjkzYzA5ZjNjYjc4MmRkNGEzMWFiMTRmNjhiMWU2YzIz\"},\"staticContentType\":\"suicide_prevention_message\",\"internalUrl\":\"\",\"id\":\"U3RhdGljQ29udGVudEAwOnN1aWNpZGVfcHJldmVudGlvbl9tZXNzYWdl\"}},\"author\":{\"id\":\"VXNlckAwOjQxMjQ4MTUy\",\"uid\":41248152,\"__typename\":\"User\",\"useTranslatedName\":false,\"isMachineAnswerBot\":false,\"names\":[],\"adminNames\":[],\"isAnon\":false,\"profileUrl\":null,\"smallProfileImageUrl\":\"https://qsf.cf2.quoracdn.net/-4-images.new_grid.profile_default.png-26-688c79556f251aa0.png\",\"profileImageUrl\":\"https://qsf.cf2.quoracdn.net/-4-images.new_grid.profile_default.png-26-688c79556f251aa0.png\",\"isVerified\":false,\"businessStatus\":null,\"consumerBundleActive\":false,\"producerBundleStatus\":\"never_enrolled\",\"viewerHasMuted\":false},\"__isContentObject\":\"Answer\",\"shouldBlurAllImages\":false,\"creationTime\":1540295633243726,\"hasSuicideTopics\":false,\"updatedTime\":0,\"authorTribeUser\":null,\"__isCredentialContainer\":\"Answer\",\"authorCredential\":{\"id\":\"TGlmZUV4cGVyaWVuY2VDcmVkZW50aWFsQDA6OTk5ODE1NDk=\",\"__typename\":\"LifeExperienceCredential\",\"__isCredential\":\"LifeExperienceCredential\",\"translatedString\":\"Working for quite some time in Javascript\",\"experience\":{\"id\":\"VG9waWNAMDo5NDU=\",\"__typename\":\"Topic\",\"tid\":945,\"name\":\"JavaScript (programming language)\"},\"description\":\"Working for quite some time in Javascript\",\"isDefault\":false,\"isBad\":false,\"isEnqueued\":false,\"credentialId\":99981549},\"isTranslated\":false,\"url\":\"/What-is-callback-in-javascript/answers/105115458\",\"isOwnTranslation\":false,\"businessCredential\":null,\"businessAnswer\":null,\"credibilityFacts\":[{\"__typename\":\"AuthorInfoFact\",\"id\":\"QXV0aG9ySW5mb0ZhY3RAMDoxMDUxMTU0NTg6WzExMiwgMzU5ODMwXQ==\",\"viewCount\":359830,\"answerCount\":112}],\"sourceNetwork\":null,\"sourceQuestion\":null,\"sourceAnswer\":null,\"effectiveAccessOption\":\"free\",\"monetizationIneligibilityReasons\":[],\"notForReproduction\":false,\"numViews\":501,\"__isVotable\":\"Answer\",\"numUpvotes\":1,\"__isQuoraShareable\":\"Answer\",\"numShares\":0,\"moderationCollapseType\":null,\"numRequesters\":0,\"requesters\":[],\"isCommentsDisabled\":false,\"isCollapsedForViewer\":false,\"isModerationLocked\":false,\"moderationCollapseTypeUrl\":null,\"network\":{\"id\":\"TmV0d29yazow\",\"__typename\":\"Network\",\"contentLanguageCode\":\"en\",\"appealsFormUrl\":\"https://help.quora.com/hc/en/requests/new?ticket_form_id=198746\"},\"collapseOperation\":null,\"numDisplayComments\":0,\"__isReportable\":\"Answer\",\"reportableId\":105115458,\"canViewerReport\":false,\"viewerVoteType\":\"novote\"}},\"cursor\":\"33\"},{\"id\":\"UXVlc3Rpb25QYWdlZExpc3RFZGdlOjM0\",\"__typename\":\"QuestionPagedListEdge\",\"node\":{\"id\":\"UXVlc3Rpb25SZWxldmFudEFuc3dlckl0ZW0yQDA6MzIzNTkyNjphbnN3ZXI6MjEwMjc2NDAy\",\"__typename\":\"QuestionRelevantAnswerItem2\",\"__isQuestionPagedListItem\":\"QuestionRelevantAnswerItem2\",\"question\":{\"qid\":3235926,\"id\":\"UXVlc3Rpb25AMDozMjM1OTI2\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"What is a simple explanation of higher order functions and callbacks in JavaScript?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"isQuestionDecanonActive\":true,\"areRelatedAnswersEnabled\":true},\"index\":30,\"isEquivalentAnswer\":false,\"relatedQuestion\":{\"qid\":69595910,\"id\":\"UXVlc3Rpb25AMDo2OTU5NTkxMA==\"},\"answer\":{\"originalQuestionIfDifferent\":null,\"id\":\"QW5zd2VyQDA6MjEwMjc2NDAy\",\"aid\":210276402,\"isDeleted\":false,\"isMachineAnswer\":false,\"content\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"Callback\\\", \\\"modifiers\\\": {\\\"bold\\\": true}}, {\\\"text\\\": \\\" is declared to be called later. They are used to define a \\\\u201cbehavior\\\\u201d in response to some events like \\\\u201cuser clicked that button\\\\u201d. Callbacks are like parts of such a machine:\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"\\\", \\\"modifiers\\\": {\\\"embed\\\": {\\\"url\\\": \\\"https://m.youtube.com/watch?v=auIlGqEyTm8\\\"}}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"yt-embed\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"except they can be executed several times without manual \\\\u201crecharging\\\\u201d. and of course using that much callbacks for a single purpose would be as clumsy in code as this machine is for real life purpose.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Immediately invoked function\\\", \\\"modifiers\\\": {\\\"bold\\\": true}}, {\\\"text\\\": \\\" is invoked \\\\u2026 immediately. It is used mainly for module pattern or to hide local variables, but with introduction of modules in ECMAScript 2015 (bonus points if you guessed when it appeared) and block scopes, it\\\\u2019s no longer very useful.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"As of hiding variables, think of it as a \\\\u201cblanket\\\\u201d. You came to picnic and put a blanket to sit and eat on it. Then it\\\\u2019s time to go, instead of manually picking every crumb and piece of trash, you roll the blanket and throw it away (let\\\\u2019s say it\\\\u2019s 100% biodegradable and cheap).\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"You can read about module pattern for example here: \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"Learning JavaScript Design Pattern\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"https://addyosmani.com/resources/essentialjsdesignpatterns/book/#modulepatternjavascript\\\"}}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"questionPageImpressionHash\":\"answer_ranking|628149475\",\"viewerHasAccess\":true,\"feedbackSurveyVariant\":0,\"tribeItem\":null,\"__typename\":\"Answer\",\"viewHash\":\"a-210276402_217c6a9c8869eb70245c161aeb90ce6d\",\"isSelectedForDigestClickthroughSurvey\":false,\"question\":{\"qid\":69595910,\"id\":\"UXVlc3Rpb25AMDo2OTU5NTkxMA==\",\"isDeleted\":false,\"url\":\"/What-is-the-difference-between-a-callback-function-and-an-immediately-invoked-function-expression-in-JavaScript\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"What is the difference between a callback function and an immediately-invoked function expression in JavaScript?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"__typename\":\"Question\",\"isPartnerQuestion\":false,\"isTrendyQuestion\":false,\"isFollowUpQuestion\":false,\"asker\":{\"id\":\"VXNlckAwOjQyMDQ4MTYyMg==\",\"__typename\":\"User\",\"isEmployee\":false,\"uid\":420481622},\"slug\":\"What-is-the-difference-between-a-callback-function-and-an-immediately-invoked-function-expression-in-JavaScript\",\"network\":{\"nid\":0,\"id\":\"TmV0d29yazow\"},\"tribeItem\":null,\"answerCount\":3,\"suggestedReplies\":[\"Can you explain more about the scope created by IIFEs?\",\"What are some common use cases for callback functions?\",\"How do promises relate to callback functions in JavaScript?\"]},\"permaUrl\":\"/What-is-the-difference-between-a-callback-function-and-an-immediately-invoked-function-expression-in-JavaScript/answer/Kirill-Sukhomlin\",\"isVisibleToViewer\":true,\"viewerIsAuthor\":false,\"isShortContent\":false,\"permaUrlOnOriginalQuestion\":\"/What-is-the-difference-between-a-callback-function-and-an-immediately-invoked-function-expression-in-JavaScript/answer/Kirill-Sukhomlin\",\"viewerCanRestoreAnswer\":false,\"__isMonetizable\":\"Answer\",\"oid\":210276402,\"contentType\":\"answer\",\"tribe\":null,\"viewer\":{\"consumerBundleSubscription\":null,\"id\":\"Vmlld2VyQDA6MA==\",\"tribeDirectSubscriptions\":[],\"user\":null,\"staticContent\":{\"title\":\"There is help\",\"contentQtextDocument\":{\"legacyJson\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"Need Help? Contact a suicide hotline if you need someone to talk to. If you have a friend in need of help, please encourage that person to contact a suicide hotline as well.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Worldwide\\\\nIn general, if you're outside the US, numbers for your country are here: \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"Help a friend - Befrienders Worldwide\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"http://www.befrienders.org/support/helplines.asp\\\"}}}, {\\\"text\\\": \\\". You can also e-mail \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"jo@samaritans.org\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"mailto:jo@samaritans.org\\\"}}}, {\\\"text\\\": \\\" to talk to someone or visit \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"samaritans.org\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"https://www.samaritans.org/how-we-can-help-you/contact-us\\\"}}}, {\\\"text\\\": \\\" to speak with someone.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"unordered-list\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"United States\\\\nCall the \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"National Suicide Prevention Lifeline\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"https://suicidepreventionlifeline.org/\\\"}}}, {\\\"text\\\": \\\" at 1-800-273-TALK (8255).\\\\nPara espa\\u00f1ol, llame al \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"1-888-628-9454\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"#\\\"}}}, {\\\"text\\\": \\\".\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"unordered-list\\\", \\\"is_rtl\\\": false}]}\",\"id\":\"UXRleHREb2N1bWVudEAwOjkzYzA5ZjNjYjc4MmRkNGEzMWFiMTRmNjhiMWU2YzIz\"},\"staticContentType\":\"suicide_prevention_message\",\"internalUrl\":\"\",\"id\":\"U3RhdGljQ29udGVudEAwOnN1aWNpZGVfcHJldmVudGlvbl9tZXNzYWdl\"}},\"author\":{\"id\":\"VXNlckAwOjE1NDU0NjIx\",\"uid\":15454621,\"__typename\":\"User\",\"useTranslatedName\":false,\"isMachineAnswerBot\":false,\"names\":[{\"__typename\":\"UserName\",\"id\":\"VXNlck5hbWU6MTU0NTQ2MjE6TEFUTg==\",\"reverseOrder\":false,\"givenName\":\"Kirill\",\"familyName\":\"Sukhomlin\",\"scriptCode\":\"LATN\"}],\"adminNames\":[],\"isAnon\":false,\"profileUrl\":\"/profile/Kirill-Sukhomlin\",\"smallProfileImageUrl\":\"https://qsf.cf2.quoracdn.net/-4-images.new_grid.profile_default.png-26-688c79556f251aa0.png\",\"profileImageUrl\":\"https://qsf.cf2.quoracdn.net/-4-images.new_grid.profile_default.png-26-688c79556f251aa0.png\",\"isVerified\":false,\"businessStatus\":null,\"consumerBundleActive\":false,\"producerBundleStatus\":\"never_enrolled\",\"viewerHasMuted\":false},\"__isContentObject\":\"Answer\",\"shouldBlurAllImages\":false,\"creationTime\":1587298150976352,\"hasSuicideTopics\":false,\"updatedTime\":0,\"authorTribeUser\":null,\"__isCredentialContainer\":\"Answer\",\"authorCredential\":{\"id\":\"TGlmZUV4cGVyaWVuY2VDcmVkZW50aWFsQDA6OTAwNzUwNQ==\",\"__typename\":\"LifeExperienceCredential\",\"__isCredential\":\"LifeExperienceCredential\",\"translatedString\":\"Have been coding for more than half of my life\",\"experience\":{\"id\":\"VG9waWNAMDo3ODg=\",\"__typename\":\"Topic\",\"tid\":788,\"name\":\"Computer Programming\"},\"description\":\"Have been coding for more than half of my life\",\"isDefault\":false,\"isBad\":false,\"isEnqueued\":false,\"credentialId\":9007505},\"isTranslated\":false,\"url\":\"/What-is-the-difference-between-a-callback-function-and-an-immediately-invoked-function-expression-in-JavaScript/answer/Kirill-Sukhomlin\",\"isOwnTranslation\":false,\"businessCredential\":null,\"businessAnswer\":null,\"credibilityFacts\":[{\"__typename\":\"AuthorInfoFact\",\"id\":\"QXV0aG9ySW5mb0ZhY3RAMDoyMTAyNzY0MDI6WzgzLCAxMTQwMDld\",\"viewCount\":114009,\"answerCount\":83}],\"sourceNetwork\":null,\"sourceQuestion\":null,\"sourceAnswer\":null,\"effectiveAccessOption\":\"free\",\"monetizationIneligibilityReasons\":[],\"notForReproduction\":false,\"numViews\":1238,\"__isVotable\":\"Answer\",\"numUpvotes\":1,\"__isQuoraShareable\":\"Answer\",\"numShares\":0,\"moderationCollapseType\":null,\"numRequesters\":1,\"requesters\":[{\"id\":\"VXNlckAwOjQyMDQ4MTYyMg==\",\"__typename\":\"User\",\"uid\":420481622,\"isAnon\":false,\"useTranslatedName\":false,\"isMachineAnswerBot\":false,\"names\":[{\"__typename\":\"UserName\",\"id\":\"VXNlck5hbWU6NDIwNDgxNjIyOkxBVE4=\",\"reverseOrder\":false,\"givenName\":\"Davidson\",\"familyName\":\"Julot\",\"scriptCode\":\"LATN\"}],\"adminNames\":[],\"profileUrl\":\"/profile/Davidson-Julot-1\"}],\"isCommentsDisabled\":false,\"isCollapsedForViewer\":false,\"isModerationLocked\":false,\"moderationCollapseTypeUrl\":null,\"network\":{\"id\":\"TmV0d29yazow\",\"__typename\":\"Network\",\"contentLanguageCode\":\"en\",\"appealsFormUrl\":\"https://help.quora.com/hc/en/requests/new?ticket_form_id=198746\"},\"collapseOperation\":null,\"numDisplayComments\":0,\"__isReportable\":\"Answer\",\"reportableId\":210276402,\"canViewerReport\":false,\"viewerVoteType\":\"novote\"}},\"cursor\":\"34\"},{\"id\":\"UXVlc3Rpb25QYWdlZExpc3RFZGdlOjM1\",\"__typename\":\"QuestionPagedListEdge\",\"node\":{\"id\":\"UXVlc3Rpb25SZWxldmFudEFuc3dlckl0ZW0yQDA6MzIzNTkyNjphbnN3ZXI6MzYwNDAxMDky\",\"__typename\":\"QuestionRelevantAnswerItem2\",\"__isQuestionPagedListItem\":\"QuestionRelevantAnswerItem2\",\"question\":{\"qid\":3235926,\"id\":\"UXVlc3Rpb25AMDozMjM1OTI2\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"What is a simple explanation of higher order functions and callbacks in JavaScript?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"isQuestionDecanonActive\":true,\"areRelatedAnswersEnabled\":true},\"index\":31,\"isEquivalentAnswer\":false,\"relatedQuestion\":{\"qid\":119201081,\"id\":\"UXVlc3Rpb25AMDoxMTkyMDEwODE=\"},\"answer\":{\"originalQuestionIfDifferent\":null,\"id\":\"QW5zd2VyQDA6MzYwNDAxMDky\",\"aid\":360401092,\"isDeleted\":false,\"isMachineAnswer\":false,\"content\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"A callback function is a function that gets called when some condition is met.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"For example, in JavaScript\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"function onSuccess(response) {\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"\\\\tconsole.log(response);\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"}\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"function onError(error) {\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"\\\\tconsole.error(error);\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"}\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"fetch(\\\\u2018https://www.website.com\\\\u2019)\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\".then(onSuccess)\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\".catch(onError);\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"In this example, onSuccess and onError are the callback functions that get called when the fetch operation either succeeds or fails. The parameters passed in are either the result of the fetch operation, or the error produced by its failure.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"A complex example:\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"fetch('https://www.website.com')\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\".then( response => {\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"\\\\tresponse.data.forEach(datum => {\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"\\\\t\\\\tconsole.log(datum);\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"\\\\t});\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"})\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\".catch( error => {\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"\\\\terror.reasons.forEach(reason => {\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"\\\\t\\\\tconsole.error(reason);\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"\\\\t});\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"});\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"In this example, the callback function is an arrow function (an anonymous function). It has a data attribute, which is an array. We call the forEach function of that array within the first callback, passing in another arrow function to be the callback to that forEach function. We do a similar operation with the error.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"questionPageImpressionHash\":\"answer_ranking|-1083311424\",\"viewerHasAccess\":true,\"feedbackSurveyVariant\":0,\"tribeItem\":null,\"__typename\":\"Answer\",\"viewHash\":\"a-360401092_3e673c43c820b02adb21bbfd68944d28\",\"isSelectedForDigestClickthroughSurvey\":false,\"question\":{\"qid\":119201081,\"id\":\"UXVlc3Rpb25AMDoxMTkyMDEwODE=\",\"isDeleted\":false,\"url\":\"/In-computer-programming-what-exactly-is-callback-in-simple-terms-and-what-are-some-simple-and-complex-examples-of-it\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"In computer programming, what exactly is \\\\\\\" callback\\\\\\\" in simple terms, and what are some simple and complex examples of it?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"__typename\":\"Question\",\"isPartnerQuestion\":false,\"isTrendyQuestion\":false,\"isFollowUpQuestion\":false,\"asker\":{\"id\":\"VXNlckAwOjc2ODk4MzUy\",\"__typename\":\"User\",\"isEmployee\":false,\"uid\":76898352},\"slug\":\"In-computer-programming-what-exactly-is-callback-in-simple-terms-and-what-are-some-simple-and-complex-examples-of-it\",\"network\":{\"nid\":0,\"id\":\"TmV0d29yazow\"},\"tribeItem\":null,\"answerCount\":2,\"suggestedReplies\":[]},\"permaUrl\":\"/In-computer-programming-what-exactly-is-callback-in-simple-terms-and-what-are-some-simple-and-complex-examples-of-it/answer/Zack-Frazier-5\",\"isVisibleToViewer\":true,\"viewerIsAuthor\":false,\"isShortContent\":false,\"permaUrlOnOriginalQuestion\":\"/In-computer-programming-what-exactly-is-callback-in-simple-terms-and-what-are-some-simple-and-complex-examples-of-it/answer/Zack-Frazier-5\",\"viewerCanRestoreAnswer\":false,\"__isMonetizable\":\"Answer\",\"oid\":360401092,\"contentType\":\"answer\",\"tribe\":null,\"viewer\":{\"consumerBundleSubscription\":null,\"id\":\"Vmlld2VyQDA6MA==\",\"tribeDirectSubscriptions\":[],\"user\":null,\"staticContent\":{\"title\":\"There is help\",\"contentQtextDocument\":{\"legacyJson\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"Need Help? Contact a suicide hotline if you need someone to talk to. If you have a friend in need of help, please encourage that person to contact a suicide hotline as well.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Worldwide\\\\nIn general, if you're outside the US, numbers for your country are here: \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"Help a friend - Befrienders Worldwide\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"http://www.befrienders.org/support/helplines.asp\\\"}}}, {\\\"text\\\": \\\". You can also e-mail \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"jo@samaritans.org\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"mailto:jo@samaritans.org\\\"}}}, {\\\"text\\\": \\\" to talk to someone or visit \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"samaritans.org\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"https://www.samaritans.org/how-we-can-help-you/contact-us\\\"}}}, {\\\"text\\\": \\\" to speak with someone.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"unordered-list\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"United States\\\\nCall the \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"National Suicide Prevention Lifeline\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"https://suicidepreventionlifeline.org/\\\"}}}, {\\\"text\\\": \\\" at 1-800-273-TALK (8255).\\\\nPara espa\\u00f1ol, llame al \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"1-888-628-9454\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"#\\\"}}}, {\\\"text\\\": \\\".\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"unordered-list\\\", \\\"is_rtl\\\": false}]}\",\"id\":\"UXRleHREb2N1bWVudEAwOjkzYzA5ZjNjYjc4MmRkNGEzMWFiMTRmNjhiMWU2YzIz\"},\"staticContentType\":\"suicide_prevention_message\",\"internalUrl\":\"\",\"id\":\"U3RhdGljQ29udGVudEAwOnN1aWNpZGVfcHJldmVudGlvbl9tZXNzYWdl\"}},\"author\":{\"id\":\"VXNlckAwOjI5MjY3NjUxOQ==\",\"uid\":292676519,\"__typename\":\"User\",\"useTranslatedName\":false,\"isMachineAnswerBot\":false,\"names\":[{\"__typename\":\"UserName\",\"id\":\"VXNlck5hbWU6MjkyNjc2NTE5OkxBVE4=\",\"reverseOrder\":false,\"givenName\":\"Zack\",\"familyName\":\"Frazier\",\"scriptCode\":\"LATN\"}],\"adminNames\":[],\"isAnon\":false,\"profileUrl\":\"/profile/Zack-Frazier-5\",\"smallProfileImageUrl\":\"https://qph.cf2.quoracdn.net/main-thumb-292676519-50-ukyuakyknlkcwqnziycepgjexbketpyr.jpeg\",\"profileImageUrl\":\"https://qph.cf2.quoracdn.net/main-thumb-292676519-200-ukyuakyknlkcwqnziycepgjexbketpyr.jpeg\",\"isVerified\":false,\"businessStatus\":null,\"consumerBundleActive\":false,\"producerBundleStatus\":\"never_enrolled\",\"viewerHasMuted\":false},\"__isContentObject\":\"Answer\",\"shouldBlurAllImages\":false,\"creationTime\":1654567781552104,\"hasSuicideTopics\":false,\"updatedTime\":0,\"authorTribeUser\":null,\"__isCredentialContainer\":\"Answer\",\"authorCredential\":{\"id\":\"RnJlZUZvcm1DcmVkZW50aWFsQDA6MTA3OTkyODMy\",\"__typename\":\"FreeFormCredential\",\"__isCredential\":\"FreeFormCredential\",\"translatedString\":\"B.S. Computer Science, University of Maryland College Park\",\"credentialId\":107992832,\"isDefault\":false,\"isBad\":false,\"isEnqueued\":false,\"experience\":\"B.S. Computer Science, University of Maryland College Park\"},\"isTranslated\":false,\"url\":\"/In-computer-programming-what-exactly-is-callback-in-simple-terms-and-what-are-some-simple-and-complex-examples-of-it/answer/Zack-Frazier-5\",\"isOwnTranslation\":false,\"businessCredential\":null,\"businessAnswer\":null,\"credibilityFacts\":[{\"__typename\":\"AuthorInfoFact\",\"id\":\"QXV0aG9ySW5mb0ZhY3RAMDozNjA0MDEwOTI6WzI4NzQsIDI3ODY1MjNd\",\"viewCount\":2786523,\"answerCount\":2874}],\"sourceNetwork\":null,\"sourceQuestion\":null,\"sourceAnswer\":null,\"effectiveAccessOption\":\"free\",\"monetizationIneligibilityReasons\":[],\"notForReproduction\":false,\"numViews\":308,\"__isVotable\":\"Answer\",\"numUpvotes\":2,\"__isQuoraShareable\":\"Answer\",\"numShares\":0,\"moderationCollapseType\":null,\"numRequesters\":0,\"requesters\":[],\"isCommentsDisabled\":false,\"isCollapsedForViewer\":false,\"isModerationLocked\":false,\"moderationCollapseTypeUrl\":null,\"network\":{\"id\":\"TmV0d29yazow\",\"__typename\":\"Network\",\"contentLanguageCode\":\"en\",\"appealsFormUrl\":\"https://help.quora.com/hc/en/requests/new?ticket_form_id=198746\"},\"collapseOperation\":null,\"numDisplayComments\":0,\"__isReportable\":\"Answer\",\"reportableId\":360401092,\"canViewerReport\":false,\"viewerVoteType\":\"novote\"}},\"cursor\":\"35\"},{\"id\":\"UXVlc3Rpb25QYWdlZExpc3RFZGdlOjM2\",\"__typename\":\"QuestionPagedListEdge\",\"node\":{\"id\":\"UXVlc3Rpb25SZWxldmFudEFuc3dlckl0ZW0yQDA6MzIzNTkyNjphbnN3ZXI6NjEwOTA3MDY=\",\"__typename\":\"QuestionRelevantAnswerItem2\",\"__isQuestionPagedListItem\":\"QuestionRelevantAnswerItem2\",\"question\":{\"qid\":3235926,\"id\":\"UXVlc3Rpb25AMDozMjM1OTI2\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"What is a simple explanation of higher order functions and callbacks in JavaScript?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"isQuestionDecanonActive\":true,\"areRelatedAnswersEnabled\":true},\"index\":32,\"isEquivalentAnswer\":false,\"relatedQuestion\":{\"qid\":7558025,\"id\":\"UXVlc3Rpb25AMDo3NTU4MDI1\"},\"answer\":{\"originalQuestionIfDifferent\":{\"question\":{\"qid\":20050758,\"id\":\"UXVlc3Rpb25AMDoyMDA1MDc1OA==\",\"url\":\"/What-is-a-call-back-function-in-JavaScript\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"What is a call back function in JavaScript?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"__typename\":\"Question\",\"isPartnerQuestion\":false,\"isTrendyQuestion\":false,\"isFollowUpQuestion\":false,\"asker\":{\"id\":\"VXNlckAwOjIyMTAwMTE1Mw==\",\"__typename\":\"User\",\"isEmployee\":false,\"uid\":221001153},\"slug\":\"What-is-a-call-back-function-in-JavaScript\",\"network\":{\"nid\":0,\"id\":\"TmV0d29yazow\"},\"tribeItem\":null,\"debugInfo\":\"{}\",\"viewer\":{\"user\":null,\"id\":\"Vmlld2VyQDA6MA==\"}},\"id\":\"T3JpZ2luYWxseUFuc3dlcmVkUXVlc3Rpb25AMDo2MTA5MDcwNjoyMDA1MDc1OA==\",\"originalQuestionText\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"What is a call back function in JavaScript?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"isQuestionBannerRemoved\":false},\"id\":\"QW5zd2VyQDA6NjEwOTA3MDY=\",\"aid\":61090706,\"isDeleted\":false,\"isMachineAnswer\":false,\"content\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"A call back function is essentially code that is passed as a parameter or argument to another function which is expected to execute/call-back the given function/code in the parameter e.g \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"somefunction\\\", \\\"modifiers\\\": {\\\"bold\\\": true}}, {\\\"text\\\": \\\"(\\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"anotherfuntion\\\", \\\"modifiers\\\": {\\\"bold\\\": true}}, {\\\"text\\\": \\\"());\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"so the \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"anotherfunction \\\", \\\"modifiers\\\": {\\\"bold\\\": true}}, {\\\"text\\\": \\\"is supposed to run when the \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"somefunction \\\", \\\"modifiers\\\": {\\\"bold\\\": true}}, {\\\"text\\\": \\\"is called.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"A call back function might be as follows:\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"$(\\\\\\\"#btn_1\\\\\\\").\\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"click\\\", \\\"modifiers\\\": {\\\"bold\\\": true}}, {\\\"text\\\": \\\"(function \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"hereisCallBack\\\", \\\"modifiers\\\": {\\\"bold\\\": true}}, {\\\"text\\\": \\\"() {\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"alert(\\\\\\\"Btn 1 Clicked\\\\\\\");\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"});\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"In this case, the \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"click \\\", \\\"modifiers\\\": {\\\"bold\\\": true}}, {\\\"text\\\": \\\"function is a jQuery function and the call-back function is \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"hereisCallBack\\\", \\\"modifiers\\\": {\\\"bold\\\": true}}, {\\\"text\\\": \\\".\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"The \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"hereisCallBack \\\", \\\"modifiers\\\": {\\\"bold\\\": true}}, {\\\"text\\\": \\\"is to be executed when the \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"click \\\", \\\"modifiers\\\": {\\\"bold\\\": true}}, {\\\"text\\\": \\\"function is called. So the \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"hereIsCallBack \\\", \\\"modifiers\\\": {\\\"bold\\\": true}}, {\\\"text\\\": \\\"will call the \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"alert \\\", \\\"modifiers\\\": {\\\"bold\\\": true}}, {\\\"text\\\": \\\"function. \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"Note \\\", \\\"modifiers\\\": {\\\"bold\\\": true}}, {\\\"text\\\": \\\"that the\\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\" alert function is NOT call-back function\\\", \\\"modifiers\\\": {\\\"bold\\\": true}}, {\\\"text\\\": \\\" but the \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"hereisCallBack \\\", \\\"modifiers\\\": {\\\"bold\\\": true}}, {\\\"text\\\": \\\"is a \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"call back function.\\\", \\\"modifiers\\\": {\\\"bold\\\": true}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"questionPageImpressionHash\":\"answer_ranking|-1662616831\",\"viewerHasAccess\":true,\"feedbackSurveyVariant\":0,\"tribeItem\":null,\"__typename\":\"Answer\",\"viewHash\":\"a-61090706_71ad3845539ead12d0606bfe3e1348b5\",\"isSelectedForDigestClickthroughSurvey\":false,\"question\":{\"qid\":7558025,\"id\":\"UXVlc3Rpb25AMDo3NTU4MDI1\",\"isDeleted\":false,\"url\":\"/What-is-callback-in-javascript\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"What is callback in javascript?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"__typename\":\"Question\",\"isPartnerQuestion\":false,\"isTrendyQuestion\":false,\"isFollowUpQuestion\":false,\"asker\":{\"id\":\"VXNlckAwOjEyMTM5NDk0MQ==\",\"__typename\":\"User\",\"isEmployee\":false,\"uid\":121394941},\"slug\":\"What-is-callback-in-javascript\",\"network\":{\"nid\":0,\"id\":\"TmV0d29yazow\"},\"tribeItem\":null,\"answerCount\":16,\"suggestedReplies\":[\"Can you explain how Promises improve upon callbacks?\",\"What are the downsides of using callbacks in JavaScript?\",\"How does async/await work in relation to callbacks?\"]},\"permaUrl\":\"/What-is-callback-in-javascript/answer/Bhaulik-Patel-1\",\"isVisibleToViewer\":true,\"viewerIsAuthor\":false,\"isShortContent\":false,\"permaUrlOnOriginalQuestion\":\"/What-is-a-call-back-function-in-JavaScript/answer/Bhaulik-Patel-1?no_redirect=1\",\"viewerCanRestoreAnswer\":false,\"__isMonetizable\":\"Answer\",\"oid\":61090706,\"contentType\":\"answer\",\"tribe\":null,\"viewer\":{\"consumerBundleSubscription\":null,\"id\":\"Vmlld2VyQDA6MA==\",\"tribeDirectSubscriptions\":[],\"user\":null,\"staticContent\":{\"title\":\"There is help\",\"contentQtextDocument\":{\"legacyJson\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"Need Help? Contact a suicide hotline if you need someone to talk to. If you have a friend in need of help, please encourage that person to contact a suicide hotline as well.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Worldwide\\\\nIn general, if you're outside the US, numbers for your country are here: \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"Help a friend - Befrienders Worldwide\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"http://www.befrienders.org/support/helplines.asp\\\"}}}, {\\\"text\\\": \\\". You can also e-mail \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"jo@samaritans.org\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"mailto:jo@samaritans.org\\\"}}}, {\\\"text\\\": \\\" to talk to someone or visit \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"samaritans.org\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"https://www.samaritans.org/how-we-can-help-you/contact-us\\\"}}}, {\\\"text\\\": \\\" to speak with someone.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"unordered-list\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"United States\\\\nCall the \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"National Suicide Prevention Lifeline\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"https://suicidepreventionlifeline.org/\\\"}}}, {\\\"text\\\": \\\" at 1-800-273-TALK (8255).\\\\nPara espa\\u00f1ol, llame al \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"1-888-628-9454\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"#\\\"}}}, {\\\"text\\\": \\\".\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"unordered-list\\\", \\\"is_rtl\\\": false}]}\",\"id\":\"UXRleHREb2N1bWVudEAwOjkzYzA5ZjNjYjc4MmRkNGEzMWFiMTRmNjhiMWU2YzIz\"},\"staticContentType\":\"suicide_prevention_message\",\"internalUrl\":\"\",\"id\":\"U3RhdGljQ29udGVudEAwOnN1aWNpZGVfcHJldmVudGlvbl9tZXNzYWdl\"}},\"author\":{\"id\":\"VXNlckAwOjE3MDI0MjAzMQ==\",\"uid\":170242031,\"__typename\":\"User\",\"useTranslatedName\":false,\"isMachineAnswerBot\":false,\"names\":[{\"__typename\":\"UserName\",\"id\":\"VXNlck5hbWU6MTcwMjQyMDMxOkxBVE4=\",\"reverseOrder\":false,\"givenName\":\"Bhaulik\",\"familyName\":\"Patel\",\"scriptCode\":\"LATN\"}],\"adminNames\":[],\"isAnon\":false,\"profileUrl\":\"/profile/Bhaulik-Patel-1\",\"smallProfileImageUrl\":\"https://qph.cf2.quoracdn.net/main-thumb-170242031-50-vlqnouuqhstgpdhfvxomiqqrmvwlmded.jpeg\",\"profileImageUrl\":\"https://qph.cf2.quoracdn.net/main-thumb-170242031-200-vlqnouuqhstgpdhfvxomiqqrmvwlmded.jpeg\",\"isVerified\":false,\"businessStatus\":null,\"consumerBundleActive\":false,\"producerBundleStatus\":\"never_enrolled\",\"viewerHasMuted\":false},\"__isContentObject\":\"Answer\",\"shouldBlurAllImages\":false,\"creationTime\":1508961088872644,\"hasSuicideTopics\":false,\"updatedTime\":1508961174349884,\"authorTribeUser\":null,\"__isCredentialContainer\":\"Answer\",\"authorCredential\":{\"id\":\"V29ya0NyZWRlbnRpYWxAMDo1MzU3MDUzMw==\",\"__typename\":\"WorkCredential\",\"__isCredential\":\"WorkCredential\",\"translatedString\":\"Software Developer (2014-present)\",\"isDefault\":false,\"isBad\":false,\"isEnqueued\":false,\"credentialId\":53570533,\"position\":\"Software Developer\",\"endYear\":\"-1\",\"companyName\":null,\"company\":null,\"startYear\":\"2014\"},\"isTranslated\":false,\"url\":\"/What-is-callback-in-javascript/answer/Bhaulik-Patel-1\",\"isOwnTranslation\":false,\"businessCredential\":null,\"businessAnswer\":null,\"credibilityFacts\":[{\"__typename\":\"AuthorInfoFact\",\"id\":\"QXV0aG9ySW5mb0ZhY3RAMDo2MTA5MDcwNjpbNTUsIDE5MTY2OV0=\",\"viewCount\":191669,\"answerCount\":55}],\"sourceNetwork\":null,\"sourceQuestion\":null,\"sourceAnswer\":null,\"effectiveAccessOption\":\"free\",\"monetizationIneligibilityReasons\":[],\"notForReproduction\":false,\"numViews\":1046,\"__isVotable\":\"Answer\",\"numUpvotes\":4,\"__isQuoraShareable\":\"Answer\",\"numShares\":0,\"moderationCollapseType\":null,\"numRequesters\":0,\"requesters\":[],\"isCommentsDisabled\":false,\"isCollapsedForViewer\":false,\"isModerationLocked\":false,\"moderationCollapseTypeUrl\":null,\"network\":{\"id\":\"TmV0d29yazow\",\"__typename\":\"Network\",\"contentLanguageCode\":\"en\",\"appealsFormUrl\":\"https://help.quora.com/hc/en/requests/new?ticket_form_id=198746\"},\"collapseOperation\":null,\"numDisplayComments\":0,\"__isReportable\":\"Answer\",\"reportableId\":61090706,\"canViewerReport\":false,\"viewerVoteType\":\"novote\"}},\"cursor\":\"36\"},{\"id\":\"UXVlc3Rpb25QYWdlZExpc3RFZGdlOjM3\",\"__typename\":\"QuestionPagedListEdge\",\"node\":{\"id\":\"UXVlc3Rpb25SZWxldmFudEFuc3dlckl0ZW0yQDA6MzIzNTkyNjphbnN3ZXI6MTEzMjgwNDk5\",\"__typename\":\"QuestionRelevantAnswerItem2\",\"__isQuestionPagedListItem\":\"QuestionRelevantAnswerItem2\",\"question\":{\"qid\":3235926,\"id\":\"UXVlc3Rpb25AMDozMjM1OTI2\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"What is a simple explanation of higher order functions and callbacks in JavaScript?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"isQuestionDecanonActive\":true,\"areRelatedAnswersEnabled\":true},\"index\":33,\"isEquivalentAnswer\":false,\"relatedQuestion\":{\"qid\":38531887,\"id\":\"UXVlc3Rpb25AMDozODUzMTg4Nw==\"},\"answer\":{\"originalQuestionIfDifferent\":null,\"id\":\"QW5zd2VyQDA6MTEzMjgwNDk5\",\"aid\":113280499,\"isDeleted\":false,\"isMachineAnswer\":false,\"content\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"A higher-order function is just a function which can create another function and return that function. i.e., the result of the function is a new function.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Why would a new function created at runtime be useful?\\\", \\\"modifiers\\\": {\\\"italic\\\": true}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"It can be useful because of closures. A new function created at runtime retains a reference to the enclosing context and its state. So, each copy of the function will capture the values in the enclosing context.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"questionPageImpressionHash\":\"answer_ranking|274160580\",\"viewerHasAccess\":true,\"feedbackSurveyVariant\":0,\"tribeItem\":null,\"__typename\":\"Answer\",\"viewHash\":\"a-113280499_81f9b7150935237c63cdb7c926f5027e\",\"isSelectedForDigestClickthroughSurvey\":false,\"question\":{\"qid\":38531887,\"id\":\"UXVlc3Rpb25AMDozODUzMTg4Nw==\",\"isDeleted\":false,\"url\":\"/What-are-higher-order-functions-in-JavaScript\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"What are higher order functions in JavaScript?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"__typename\":\"Question\",\"isPartnerQuestion\":false,\"isTrendyQuestion\":false,\"isFollowUpQuestion\":false,\"asker\":{\"id\":\"VXNlckAwOjkyNTQ2NDA4\",\"__typename\":\"User\",\"isEmployee\":false,\"uid\":92546408},\"slug\":\"What-are-higher-order-functions-in-JavaScript\",\"network\":{\"nid\":0,\"id\":\"TmV0d29yazow\"},\"tribeItem\":null,\"answerCount\":4,\"suggestedReplies\":[\"Can you explain how closures work in relation to higher-order functions?\",\"What are some practical examples of using higher-order functions in real projects?\",\"How do higher-order functions differ from regular functions in JavaScript?\"]},\"permaUrl\":\"/What-are-higher-order-functions-in-JavaScript/answer/Theodore-Ravindranath\",\"isVisibleToViewer\":true,\"viewerIsAuthor\":false,\"isShortContent\":false,\"permaUrlOnOriginalQuestion\":\"/What-are-higher-order-functions-in-JavaScript/answer/Theodore-Ravindranath\",\"viewerCanRestoreAnswer\":false,\"__isMonetizable\":\"Answer\",\"oid\":113280499,\"contentType\":\"answer\",\"tribe\":null,\"viewer\":{\"consumerBundleSubscription\":null,\"id\":\"Vmlld2VyQDA6MA==\",\"tribeDirectSubscriptions\":[],\"user\":null,\"staticContent\":{\"title\":\"There is help\",\"contentQtextDocument\":{\"legacyJson\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"Need Help? Contact a suicide hotline if you need someone to talk to. If you have a friend in need of help, please encourage that person to contact a suicide hotline as well.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Worldwide\\\\nIn general, if you're outside the US, numbers for your country are here: \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"Help a friend - Befrienders Worldwide\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"http://www.befrienders.org/support/helplines.asp\\\"}}}, {\\\"text\\\": \\\". You can also e-mail \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"jo@samaritans.org\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"mailto:jo@samaritans.org\\\"}}}, {\\\"text\\\": \\\" to talk to someone or visit \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"samaritans.org\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"https://www.samaritans.org/how-we-can-help-you/contact-us\\\"}}}, {\\\"text\\\": \\\" to speak with someone.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"unordered-list\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"United States\\\\nCall the \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"National Suicide Prevention Lifeline\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"https://suicidepreventionlifeline.org/\\\"}}}, {\\\"text\\\": \\\" at 1-800-273-TALK (8255).\\\\nPara espa\\u00f1ol, llame al \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"1-888-628-9454\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"#\\\"}}}, {\\\"text\\\": \\\".\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"unordered-list\\\", \\\"is_rtl\\\": false}]}\",\"id\":\"UXRleHREb2N1bWVudEAwOjkzYzA5ZjNjYjc4MmRkNGEzMWFiMTRmNjhiMWU2YzIz\"},\"staticContentType\":\"suicide_prevention_message\",\"internalUrl\":\"\",\"id\":\"U3RhdGljQ29udGVudEAwOnN1aWNpZGVfcHJldmVudGlvbl9tZXNzYWdl\"}},\"author\":{\"id\":\"VXNlckAwOjE3ODA2NDY3\",\"uid\":17806467,\"__typename\":\"User\",\"useTranslatedName\":false,\"isMachineAnswerBot\":false,\"names\":[{\"__typename\":\"UserName\",\"id\":\"VXNlck5hbWU6MTc4MDY0Njc6TEFUTg==\",\"reverseOrder\":false,\"givenName\":\"Theodore\",\"familyName\":\"Ravindranath\",\"scriptCode\":\"LATN\"}],\"adminNames\":[],\"isAnon\":false,\"profileUrl\":\"/profile/Theodore-Ravindranath\",\"smallProfileImageUrl\":\"https://qph.cf2.quoracdn.net/main-thumb-17806467-50-eZR6SXO71JWeHUyDrtdwKVJPhXpmvv8T.jpeg\",\"profileImageUrl\":\"https://qph.cf2.quoracdn.net/main-thumb-17806467-200-eZR6SXO71JWeHUyDrtdwKVJPhXpmvv8T.jpeg\",\"isVerified\":false,\"businessStatus\":null,\"consumerBundleActive\":false,\"producerBundleStatus\":\"never_enrolled\",\"viewerHasMuted\":false},\"__isContentObject\":\"Answer\",\"shouldBlurAllImages\":false,\"creationTime\":1545233014738682,\"hasSuicideTopics\":false,\"updatedTime\":0,\"authorTribeUser\":null,\"__isCredentialContainer\":\"Answer\",\"authorCredential\":{\"id\":\"RnJlZUZvcm1DcmVkZW50aWFsQDA6NzE2NzU0Nzk=\",\"__typename\":\"FreeFormCredential\",\"__isCredential\":\"FreeFormCredential\",\"translatedString\":\"Developing world class Software Products\",\"credentialId\":71675479,\"isDefault\":false,\"isBad\":false,\"isEnqueued\":false,\"experience\":\"Developing world class Software Products\"},\"isTranslated\":false,\"url\":\"/What-are-higher-order-functions-in-JavaScript/answer/Theodore-Ravindranath\",\"isOwnTranslation\":false,\"businessCredential\":null,\"businessAnswer\":null,\"credibilityFacts\":[{\"__typename\":\"AuthorInfoFact\",\"id\":\"QXV0aG9ySW5mb0ZhY3RAMDoxMTMyODA0OTk6WzMxMCwgNTc2NTQ1XQ==\",\"viewCount\":576545,\"answerCount\":310}],\"sourceNetwork\":null,\"sourceQuestion\":null,\"sourceAnswer\":null,\"effectiveAccessOption\":\"free\",\"monetizationIneligibilityReasons\":[],\"notForReproduction\":false,\"numViews\":399,\"__isVotable\":\"Answer\",\"numUpvotes\":2,\"__isQuoraShareable\":\"Answer\",\"numShares\":0,\"moderationCollapseType\":null,\"numRequesters\":1,\"requesters\":[{\"id\":\"VXNlckAwOjkyNTQ2NDA4\",\"__typename\":\"User\",\"uid\":92546408,\"isAnon\":false,\"useTranslatedName\":false,\"isMachineAnswerBot\":false,\"names\":[{\"__typename\":\"UserName\",\"id\":\"VXNlck5hbWU6OTI1NDY0MDg6TEFUTg==\",\"reverseOrder\":false,\"givenName\":\"Divesh\",\"familyName\":\"Mirchandani\",\"scriptCode\":\"LATN\"}],\"adminNames\":[],\"profileUrl\":\"/profile/Divesh-Mirchandani-1\"}],\"isCommentsDisabled\":false,\"isCollapsedForViewer\":false,\"isModerationLocked\":false,\"moderationCollapseTypeUrl\":null,\"network\":{\"id\":\"TmV0d29yazow\",\"__typename\":\"Network\",\"contentLanguageCode\":\"en\",\"appealsFormUrl\":\"https://help.quora.com/hc/en/requests/new?ticket_form_id=198746\"},\"collapseOperation\":null,\"numDisplayComments\":0,\"__isReportable\":\"Answer\",\"reportableId\":113280499,\"canViewerReport\":false,\"viewerVoteType\":\"novote\"}},\"cursor\":\"37\"},{\"id\":\"UXVlc3Rpb25QYWdlZExpc3RFZGdlOjM4\",\"__typename\":\"QuestionPagedListEdge\",\"node\":{\"id\":\"UXVlc3Rpb25SZWxldmFudEFuc3dlckl0ZW0yQDA6MzIzNTkyNjphbnN3ZXI6MTEyMTY4MTM5\",\"__typename\":\"QuestionRelevantAnswerItem2\",\"__isQuestionPagedListItem\":\"QuestionRelevantAnswerItem2\",\"question\":{\"qid\":3235926,\"id\":\"UXVlc3Rpb25AMDozMjM1OTI2\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"What is a simple explanation of higher order functions and callbacks in JavaScript?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"isQuestionDecanonActive\":true,\"areRelatedAnswersEnabled\":true},\"index\":34,\"isEquivalentAnswer\":false,\"relatedQuestion\":{\"qid\":38817304,\"id\":\"UXVlc3Rpb25AMDozODgxNzMwNA==\"},\"answer\":{\"originalQuestionIfDifferent\":null,\"id\":\"QW5zd2VyQDA6MTEyMTY4MTM5\",\"aid\":112168139,\"isDeleted\":false,\"isMachineAnswer\":false,\"content\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"There is no magic with callbacks. They simply are functions that get called at a later date inside a parent function.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Here is an example of a call back.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"const someFun() = (callBack) =>{\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"//Do some javascsript\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"callBack(); // run the callBack\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"}\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"const callBack = ()=>{\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"//Will run later\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"}\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\" someFun(callBack);\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"code\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"As you can see, `callBack` will run at the end of someFun.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"questionPageImpressionHash\":\"answer_ranking|-1949095640\",\"viewerHasAccess\":true,\"feedbackSurveyVariant\":0,\"tribeItem\":null,\"__typename\":\"Answer\",\"viewHash\":\"a-112168139_b1ba715d843afec7ca8a4177d5ed2a88\",\"isSelectedForDigestClickthroughSurvey\":false,\"question\":{\"qid\":38817304,\"id\":\"UXVlc3Rpb25AMDozODgxNzMwNA==\",\"isDeleted\":false,\"url\":\"/Is-there-a-simplified-way-to-understand-callbacks-in-Javascript\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"Is there a simplified way to understand callbacks in Javascript?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"__typename\":\"Question\",\"isPartnerQuestion\":false,\"isTrendyQuestion\":false,\"isFollowUpQuestion\":false,\"asker\":{\"id\":\"VXNlckAwOjgzNjg2MDY5\",\"__typename\":\"User\",\"isEmployee\":false,\"uid\":83686069},\"slug\":\"Is-there-a-simplified-way-to-understand-callbacks-in-Javascript\",\"network\":{\"nid\":0,\"id\":\"TmV0d29yazow\"},\"tribeItem\":null,\"answerCount\":4,\"suggestedReplies\":[]},\"permaUrl\":\"/Is-there-a-simplified-way-to-understand-callbacks-in-Javascript/answer/Jamie-Hutber-1\",\"isVisibleToViewer\":true,\"viewerIsAuthor\":false,\"isShortContent\":false,\"permaUrlOnOriginalQuestion\":\"/Is-there-a-simplified-way-to-understand-callbacks-in-Javascript/answer/Jamie-Hutber-1\",\"viewerCanRestoreAnswer\":false,\"__isMonetizable\":\"Answer\",\"oid\":112168139,\"contentType\":\"answer\",\"tribe\":null,\"viewer\":{\"consumerBundleSubscription\":null,\"id\":\"Vmlld2VyQDA6MA==\",\"tribeDirectSubscriptions\":[],\"user\":null,\"staticContent\":{\"title\":\"There is help\",\"contentQtextDocument\":{\"legacyJson\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"Need Help? Contact a suicide hotline if you need someone to talk to. If you have a friend in need of help, please encourage that person to contact a suicide hotline as well.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Worldwide\\\\nIn general, if you're outside the US, numbers for your country are here: \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"Help a friend - Befrienders Worldwide\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"http://www.befrienders.org/support/helplines.asp\\\"}}}, {\\\"text\\\": \\\". You can also e-mail \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"jo@samaritans.org\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"mailto:jo@samaritans.org\\\"}}}, {\\\"text\\\": \\\" to talk to someone or visit \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"samaritans.org\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"https://www.samaritans.org/how-we-can-help-you/contact-us\\\"}}}, {\\\"text\\\": \\\" to speak with someone.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"unordered-list\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"United States\\\\nCall the \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"National Suicide Prevention Lifeline\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"https://suicidepreventionlifeline.org/\\\"}}}, {\\\"text\\\": \\\" at 1-800-273-TALK (8255).\\\\nPara espa\\u00f1ol, llame al \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"1-888-628-9454\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"#\\\"}}}, {\\\"text\\\": \\\".\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"unordered-list\\\", \\\"is_rtl\\\": false}]}\",\"id\":\"UXRleHREb2N1bWVudEAwOjkzYzA5ZjNjYjc4MmRkNGEzMWFiMTRmNjhiMWU2YzIz\"},\"staticContentType\":\"suicide_prevention_message\",\"internalUrl\":\"\",\"id\":\"U3RhdGljQ29udGVudEAwOnN1aWNpZGVfcHJldmVudGlvbl9tZXNzYWdl\"}},\"author\":{\"id\":\"VXNlckAwOjExNDAyOTcyMw==\",\"uid\":114029723,\"__typename\":\"User\",\"useTranslatedName\":false,\"isMachineAnswerBot\":false,\"names\":[{\"__typename\":\"UserName\",\"id\":\"VXNlck5hbWU6MTE0MDI5NzIzOkxBVE4=\",\"reverseOrder\":false,\"givenName\":\"Jamie\",\"familyName\":\"Hutber\",\"scriptCode\":\"LATN\"}],\"adminNames\":[],\"isAnon\":false,\"profileUrl\":\"/profile/Jamie-Hutber-1\",\"smallProfileImageUrl\":\"https://qph.cf2.quoracdn.net/main-thumb-114029723-50-lwbwzbxwzdqljuekjrjooartpqlvvdyz.jpeg\",\"profileImageUrl\":\"https://qph.cf2.quoracdn.net/main-thumb-114029723-200-lwbwzbxwzdqljuekjrjooartpqlvvdyz.jpeg\",\"isVerified\":false,\"businessStatus\":null,\"consumerBundleActive\":false,\"producerBundleStatus\":\"enabled\",\"viewerHasMuted\":false},\"__isContentObject\":\"Answer\",\"shouldBlurAllImages\":false,\"creationTime\":1544652721736854,\"hasSuicideTopics\":false,\"updatedTime\":1544652789961920,\"authorTribeUser\":null,\"__isCredentialContainer\":\"Answer\",\"authorCredential\":{\"id\":\"TGlmZUV4cGVyaWVuY2VDcmVkZW50aWFsQDA6MTc2OTA3MTE=\",\"__typename\":\"LifeExperienceCredential\",\"__isCredential\":\"LifeExperienceCredential\",\"translatedString\":\"8 years working for virgin media, Nike, telegraph photo viewer, gsk, mail online\",\"experience\":{\"id\":\"VG9waWNAMDo5NDU=\",\"__typename\":\"Topic\",\"tid\":945,\"name\":\"JavaScript (programming language)\"},\"description\":\"8 years working for virgin media, Nike, telegraph photo viewer, gsk, mail online\",\"isDefault\":false,\"isBad\":false,\"isEnqueued\":false,\"credentialId\":17690711},\"isTranslated\":false,\"url\":\"/Is-there-a-simplified-way-to-understand-callbacks-in-Javascript/answer/Jamie-Hutber-1\",\"isOwnTranslation\":false,\"businessCredential\":null,\"businessAnswer\":null,\"credibilityFacts\":[],\"sourceNetwork\":null,\"sourceQuestion\":null,\"sourceAnswer\":null,\"effectiveAccessOption\":\"free\",\"monetizationIneligibilityReasons\":[],\"notForReproduction\":false,\"numViews\":259,\"__isVotable\":\"Answer\",\"numUpvotes\":4,\"__isQuoraShareable\":\"Answer\",\"numShares\":0,\"moderationCollapseType\":null,\"numRequesters\":1,\"requesters\":[{\"id\":\"VXNlckAwOjgzNjg2MDY5\",\"__typename\":\"User\",\"uid\":83686069,\"isAnon\":false,\"useTranslatedName\":false,\"isMachineAnswerBot\":false,\"names\":[{\"__typename\":\"UserName\",\"id\":\"VXNlck5hbWU6ODM2ODYwNjk6TEFUTg==\",\"reverseOrder\":false,\"givenName\":\"Nikolas\",\"familyName\":\"Smith\",\"scriptCode\":\"LATN\"}],\"adminNames\":[],\"profileUrl\":\"/profile/Nikolas-Smith-3\"}],\"isCommentsDisabled\":false,\"isCollapsedForViewer\":false,\"isModerationLocked\":false,\"moderationCollapseTypeUrl\":null,\"network\":{\"id\":\"TmV0d29yazow\",\"__typename\":\"Network\",\"contentLanguageCode\":\"en\",\"appealsFormUrl\":\"https://help.quora.com/hc/en/requests/new?ticket_form_id=198746\"},\"collapseOperation\":null,\"numDisplayComments\":1,\"__isReportable\":\"Answer\",\"reportableId\":112168139,\"canViewerReport\":false,\"viewerVoteType\":\"novote\"}},\"cursor\":\"38\"}]},\"qid\":3235926,\"id\":\"UXVlc3Rpb25AMDozMjM1OTI2\",\"isDeleted\":false,\"viewerHasAnswered\":false,\"isVisibleToViewer\":true,\"asker\":{\"uid\":221001153,\"id\":\"VXNlckAwOjIyMTAwMTE1Mw==\",\"__typename\":\"User\",\"isEmployee\":false},\"deleteOperation\":null,\"viewer\":{\"user\":null,\"canSeeDeletedContent\":false,\"id\":\"Vmlld2VyQDA6MA==\",\"staticContent\":{\"title\":\"There is help\",\"contentQtextDocument\":{\"legacyJson\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"Need Help? Contact a suicide hotline if you need someone to talk to. If you have a friend in need of help, please encourage that person to contact a suicide hotline as well.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"Worldwide\\\\nIn general, if you're outside the US, numbers for your country are here: \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"Help a friend - Befrienders Worldwide\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"http://www.befrienders.org/support/helplines.asp\\\"}}}, {\\\"text\\\": \\\". You can also e-mail \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"jo@samaritans.org\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"mailto:jo@samaritans.org\\\"}}}, {\\\"text\\\": \\\" to talk to someone or visit \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"samaritans.org\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"https://www.samaritans.org/how-we-can-help-you/contact-us\\\"}}}, {\\\"text\\\": \\\" to speak with someone.\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"unordered-list\\\", \\\"is_rtl\\\": false}, {\\\"spans\\\": [{\\\"text\\\": \\\"United States\\\\nCall the \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"National Suicide Prevention Lifeline\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"https://suicidepreventionlifeline.org/\\\"}}}, {\\\"text\\\": \\\" at 1-800-273-TALK (8255).\\\\nPara espa\\u00f1ol, llame al \\\", \\\"modifiers\\\": {}}, {\\\"text\\\": \\\"1-888-628-9454\\\", \\\"modifiers\\\": {\\\"link\\\": {\\\"type\\\": \\\"url\\\", \\\"url\\\": \\\"#\\\"}}}, {\\\"text\\\": \\\".\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"unordered-list\\\", \\\"is_rtl\\\": false}]}\",\"id\":\"UXRleHREb2N1bWVudEAwOjkzYzA5ZjNjYjc4MmRkNGEzMWFiMTRmNjhiMWU2YzIz\"},\"staticContentType\":\"suicide_prevention_message\",\"internalUrl\":\"\",\"id\":\"U3RhdGljQ29udGVudEAwOnN1aWNpZGVfcHJldmVudGlvbl9tZXNzYWdl\"},\"noteModernStandardArabic\":false},\"__typename\":\"Question\",\"viewerHasDrafted\":false,\"viewerAnswer\":null,\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"What is a simple explanation of higher order functions and callbacks in JavaScript?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"isPartnerQuestion\":false,\"isTrendyQuestion\":false,\"isFollowUpQuestion\":false,\"url\":\"/What-is-a-simple-explanation-of-higher-order-functions-and-callbacks-in-JavaScript\",\"slug\":\"What-is-a-simple-explanation-of-higher-order-functions-and-callbacks-in-JavaScript\",\"network\":{\"nid\":0,\"id\":\"TmV0d29yazow\",\"productUpdatesSpaceUrl\":\"https://productupdates.quora.com/\",\"contentLanguageCode\":\"en\"},\"tribeItem\":null,\"redirectToQuestion\":null,\"shouldDisplaySelfHarmBanner\":false,\"topics\":[{\"id\":\"VG9waWNAMDo3ODU=\",\"__typename\":\"Topic\",\"tid\":785,\"name\":\"Programming Languages\",\"topicBannerContent\":null,\"url\":\"/topic/Programming-Languages\"},{\"id\":\"VG9waWNAMDo3ODg=\",\"__typename\":\"Topic\",\"tid\":788,\"name\":\"Computer Programming\",\"topicBannerContent\":null,\"url\":\"/topic/Computer-Programming\"},{\"id\":\"VG9waWNAMDo5NDU=\",\"__typename\":\"Topic\",\"tid\":945,\"name\":\"JavaScript (programming language)\",\"topicBannerContent\":null,\"url\":\"/topic/JavaScript-programming-language\"},{\"id\":\"VG9waWNAMDoxMDA0Nw==\",\"__typename\":\"Topic\",\"tid\":10047,\"name\":\"Software Development\",\"topicBannerContent\":null,\"url\":\"/topic/Software-Development\"},{\"id\":\"VG9waWNAMDoxNTE4NTkw\",\"__typename\":\"Topic\",\"tid\":1518590,\"name\":\"Callbacks\",\"topicBannerContent\":null,\"url\":\"/topic/Callbacks\"},{\"id\":\"VG9waWNAMDoyNzkzNTA3\",\"__typename\":\"Topic\",\"tid\":2793507,\"name\":\"Computer Programming and Coding\",\"topicBannerContent\":null,\"url\":\"/topic/Computer-Programming-and-Coding\"},{\"id\":\"VG9waWNAMDozMDgyMzkx\",\"__typename\":\"Topic\",\"tid\":3082391,\"name\":\"Computer Science and Programming\",\"topicBannerContent\":null,\"url\":\"/topic/Computer-Science-and-Programming\"},{\"id\":\"VG9waWNAMDozMjQ4MjE3\",\"__typename\":\"Topic\",\"tid\":3248217,\"name\":\"JavaScript Programming\",\"topicBannerContent\":null,\"url\":\"/topic/JavaScript-Programming\"},{\"id\":\"VG9waWNAMDozOTM2ODU5\",\"__typename\":\"Topic\",\"tid\":3936859,\"name\":\"JavaScript Technology\",\"topicBannerContent\":null,\"url\":\"/topic/JavaScript-Technology\"},{\"id\":\"VG9waWNAMDozOTM4ODEx\",\"__typename\":\"Topic\",\"tid\":3938811,\"name\":\"Higher Order Function\",\"topicBannerContent\":null,\"url\":\"/topic/Higher-Order-Function\"},{\"id\":\"VG9waWNAMDo1ODgwMDIy\",\"__typename\":\"Topic\",\"tid\":5880022,\"name\":\"Programming in the Language\",\"topicBannerContent\":null,\"url\":\"/topic/Programming-in-the-Language\"},{\"id\":\"VG9waWNAMDo3NzIwNjc5\",\"__typename\":\"Topic\",\"tid\":7720679,\"name\":\"Generalised Functions\",\"topicBannerContent\":null,\"url\":\"/topic/Generalised-Functions\"},{\"id\":\"VG9waWNAMDo4MTg1MDM1\",\"__typename\":\"Topic\",\"tid\":8185035,\"name\":\"Computer Programming and Applications\",\"topicBannerContent\":null,\"url\":\"/topic/Computer-Programming-and-Applications\"},{\"id\":\"VG9waWNAMDo4Njc4NDEz\",\"__typename\":\"Topic\",\"tid\":8678413,\"name\":\"Basic Javascript\",\"topicBannerContent\":null,\"url\":\"/topic/Basic-Javascript\"},{\"id\":\"VG9waWNAMDo5MjA3NDYw\",\"__typename\":\"Topic\",\"tid\":9207460,\"name\":\"Higher-order Constructs\",\"topicBannerContent\":null,\"url\":\"/topic/Higher-order-Constructs\"}],\"hasQuoraProductTopic\":false,\"distributionReason\":null,\"viewerCanEdit\":false,\"questionPoliciesUrl\":\"https://help.quora.com/hc/en/articles/9456583756180\",\"questionFormattingUrl\":\"https://help.quora.com/hc/en/articles/360000470823\",\"questionSpamUrl\":\"https://help.quora.com/hc/en/articles/360000470706\",\"allowedLanguagesUrl\":\"https://help.quora.com/hc/en/articles/9456583756180\",\"showNoAnswersPrompt\":false,\"numOfLinkedTribes\":0,\"showUserRequestAnswerPrompt\":false,\"showUserAnswersNeeded\":false,\"answerCount\":4,\"linkedQuestion\":null,\"shouldHideRelatedQuestionsAndAnswers\":false,\"bottomRelatedQuestionsInfo\":{\"relatedQuestions\":[{\"id\":\"UXVlc3Rpb25AMDo2MTA4MDg3Ng==\",\"__typename\":\"Question\",\"qid\":61080876,\"url\":\"/What-are-arrow-functions-in-JavaScript\",\"slug\":\"What-are-arrow-functions-in-JavaScript\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"What are arrow functions in JavaScript?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"isPartnerQuestion\":false,\"isTrendyQuestion\":false,\"isFollowUpQuestion\":false,\"asker\":{\"id\":\"VXNlckAwOjcxOTUyMjcy\",\"__typename\":\"User\",\"isEmployee\":false,\"uid\":71952272},\"network\":{\"nid\":0,\"id\":\"TmV0d29yazow\"},\"tribeItem\":null},{\"id\":\"UXVlc3Rpb25AMDoxODM0NTM4OTY=\",\"__typename\":\"Question\",\"qid\":183453896,\"url\":\"/How-can-you-implement-a-debounce-function-in-JavaScript\",\"slug\":\"How-can-you-implement-a-debounce-function-in-JavaScript\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"How can you implement a debounce function in JavaScript?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"isPartnerQuestion\":false,\"isTrendyQuestion\":false,\"isFollowUpQuestion\":false,\"asker\":{\"id\":\"VXNlckAwOjIxMDk5OTg5NDY=\",\"__typename\":\"User\",\"isEmployee\":false,\"uid\":2109998946},\"network\":{\"nid\":0,\"id\":\"TmV0d29yazow\"},\"tribeItem\":null},{\"id\":\"UXVlc3Rpb25AMDoyNTE4OTA0\",\"__typename\":\"Question\",\"qid\":2518904,\"url\":\"/Why-are-callbacks-in-JavaScript-called-callbacks\",\"slug\":\"Why-are-callbacks-in-JavaScript-called-callbacks\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"Why are callbacks in JavaScript called callbacks?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"isPartnerQuestion\":false,\"isTrendyQuestion\":false,\"isFollowUpQuestion\":false,\"asker\":{\"id\":\"VXNlckAwOjIyMTAwMTE1Mw==\",\"__typename\":\"User\",\"isEmployee\":false,\"uid\":221001153},\"network\":{\"nid\":0,\"id\":\"TmV0d29yazow\"},\"tribeItem\":null},{\"id\":\"UXVlc3Rpb25AMDoxMDUzODUzMw==\",\"__typename\":\"Question\",\"qid\":10538533,\"url\":\"/In-Javascript-is-the-pyramid-of-nested-callbacks-better-than-promises\",\"slug\":\"In-Javascript-is-the-pyramid-of-nested-callbacks-better-than-promises\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"In Javascript is the pyramid of nested callbacks better than promises?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"isPartnerQuestion\":false,\"isTrendyQuestion\":false,\"isFollowUpQuestion\":false,\"asker\":{\"id\":\"VXNlckAwOjIyMTAwMTE1Mw==\",\"__typename\":\"User\",\"isEmployee\":false,\"uid\":221001153},\"network\":{\"nid\":0,\"id\":\"TmV0d29yazow\"},\"tribeItem\":null},{\"id\":\"UXVlc3Rpb25AMDoyMjkzODM4Nw==\",\"__typename\":\"Question\",\"qid\":22938387,\"url\":\"/How-do-functions-without-parameters-work-in-JavaScript\",\"slug\":\"How-do-functions-without-parameters-work-in-JavaScript\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"How do functions without parameters work in JavaScript?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"isPartnerQuestion\":false,\"isTrendyQuestion\":false,\"isFollowUpQuestion\":false,\"asker\":{\"id\":\"VXNlckAwOjI1OTAyOTQ5Mw==\",\"__typename\":\"User\",\"isEmployee\":false,\"uid\":259029493},\"network\":{\"nid\":0,\"id\":\"TmV0d29yazow\"},\"tribeItem\":null},{\"id\":\"UXVlc3Rpb25AMDo1NjY1ODk5OQ==\",\"__typename\":\"Question\",\"qid\":56658999,\"url\":\"/Are-callbacks-dead-in-JavaScript\",\"slug\":\"Are-callbacks-dead-in-JavaScript\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"Are callbacks dead in JavaScript?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"isPartnerQuestion\":false,\"isTrendyQuestion\":false,\"isFollowUpQuestion\":false,\"asker\":{\"id\":\"VXNlckAwOjE2Nzg2MzM3Mg==\",\"__typename\":\"User\",\"isEmployee\":false,\"uid\":167863372},\"network\":{\"nid\":0,\"id\":\"TmV0d29yazow\"},\"tribeItem\":null},{\"id\":\"UXVlc3Rpb25AMDo0MzA3MzM0MA==\",\"__typename\":\"Question\",\"qid\":43073340,\"url\":\"/When-do-you-create-functions-in-Javascript\",\"slug\":\"When-do-you-create-functions-in-Javascript\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"When do you create functions in Javascript?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"isPartnerQuestion\":false,\"isTrendyQuestion\":false,\"isFollowUpQuestion\":false,\"asker\":{\"id\":\"VXNlckAwOjEwNjc5OTYyOQ==\",\"__typename\":\"User\",\"isEmployee\":false,\"uid\":106799629},\"network\":{\"nid\":0,\"id\":\"TmV0d29yazow\"},\"tribeItem\":null},{\"id\":\"UXVlc3Rpb25AMDo1NDI0Mjg3\",\"__typename\":\"Question\",\"qid\":5424287,\"url\":\"/What-are-callbacks-and-why-are-they-so-important-in-Javascript\",\"slug\":\"What-are-callbacks-and-why-are-they-so-important-in-Javascript\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"What are callbacks and why are they so important in Javascript?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"isPartnerQuestion\":false,\"isTrendyQuestion\":false,\"isFollowUpQuestion\":false,\"asker\":{\"id\":\"VXNlckAwOjIyMTAwMTE1Mw==\",\"__typename\":\"User\",\"isEmployee\":false,\"uid\":221001153},\"network\":{\"nid\":0,\"id\":\"TmV0d29yazow\"},\"tribeItem\":null},{\"id\":\"UXVlc3Rpb25AMDoxNjE4MzQ2Mw==\",\"__typename\":\"Question\",\"qid\":16183463,\"url\":\"/How-should-arrow-functions-be-used-in-Javascript\",\"slug\":\"How-should-arrow-functions-be-used-in-Javascript\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"How should arrow functions be used in Javascript?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"isPartnerQuestion\":false,\"isTrendyQuestion\":false,\"isFollowUpQuestion\":false,\"asker\":{\"id\":\"VXNlckAwOjI3NzE5OTU2\",\"__typename\":\"User\",\"isEmployee\":false,\"uid\":27719956},\"network\":{\"nid\":0,\"id\":\"TmV0d29yazow\"},\"tribeItem\":null},{\"id\":\"UXVlc3Rpb25AMDo3NTU2MTYyNw==\",\"__typename\":\"Question\",\"qid\":75561627,\"url\":\"https://naveeshkumarv.quora.com/What-is-Callback-function-in-Javascript\",\"slug\":\"What-is-Callback-function-in-Javascript-1\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"What is Callback function in Javascript?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"isPartnerQuestion\":false,\"isTrendyQuestion\":false,\"isFollowUpQuestion\":false,\"asker\":{\"id\":\"VXNlckAwOjEyNDM2NTQ5OQ==\",\"__typename\":\"User\",\"isEmployee\":false,\"uid\":124365499},\"network\":{\"nid\":0,\"id\":\"TmV0d29yazow\"},\"tribeItem\":{\"__typename\":\"QuestionTribeItem\",\"tribe\":{\"id\":\"VHJpYmVAMDoxNjUwNzA1\"},\"id\":\"UXVlc3Rpb25UcmliZUl0ZW1AMDoxMDAzNDc0MQ==\"}},{\"id\":\"UXVlc3Rpb25AMDoyNDQ1MDgx\",\"__typename\":\"Question\",\"qid\":2445081,\"url\":\"/What-are-JavaScript-callbacks-and-why-are-they-harder-to-maintain\",\"slug\":\"What-are-JavaScript-callbacks-and-why-are-they-harder-to-maintain\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"What are JavaScript callbacks, and why are they harder to maintain?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"isPartnerQuestion\":false,\"isTrendyQuestion\":false,\"isFollowUpQuestion\":false,\"asker\":{\"id\":\"VXNlckAwOjIyMTAwMTE1Mw==\",\"__typename\":\"User\",\"isEmployee\":false,\"uid\":221001153},\"network\":{\"nid\":0,\"id\":\"TmV0d29yazow\"},\"tribeItem\":null},{\"id\":\"UXVlc3Rpb25AMDoyMTQ1NDE0\",\"__typename\":\"Question\",\"qid\":2145414,\"url\":\"/What-is-the-return-function-in-JS\",\"slug\":\"What-is-the-return-function-in-JS\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"What is the 'return' function in JS?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"isPartnerQuestion\":false,\"isTrendyQuestion\":false,\"isFollowUpQuestion\":false,\"asker\":{\"id\":\"VXNlckAwOjIyMTAwMTE1Mw==\",\"__typename\":\"User\",\"isEmployee\":false,\"uid\":221001153},\"network\":{\"nid\":0,\"id\":\"TmV0d29yazow\"},\"tribeItem\":null},{\"id\":\"UXVlc3Rpb25AMDoxMDA5NTY3OQ==\",\"__typename\":\"Question\",\"qid\":10095679,\"url\":\"/In-JavaScript-what-is-the-benefit-of-defining-functions-inside-other-functions\",\"slug\":\"In-JavaScript-what-is-the-benefit-of-defining-functions-inside-other-functions\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"In JavaScript, what is the benefit of defining functions inside other functions?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"isPartnerQuestion\":false,\"isTrendyQuestion\":false,\"isFollowUpQuestion\":false,\"asker\":{\"id\":\"VXNlckAwOjIyMTAwMTE1Mw==\",\"__typename\":\"User\",\"isEmployee\":false,\"uid\":221001153},\"network\":{\"nid\":0,\"id\":\"TmV0d29yazow\"},\"tribeItem\":null},{\"id\":\"UXVlc3Rpb25AMDo2OTYyODUxNA==\",\"__typename\":\"Question\",\"qid\":69628514,\"url\":\"/What-is-the-relationship-between-a-higher-order-function-and-a-callback-function\",\"slug\":\"What-is-the-relationship-between-a-higher-order-function-and-a-callback-function\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"What is the relationship between a higher order function and a callback function?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"isPartnerQuestion\":false,\"isTrendyQuestion\":false,\"isFollowUpQuestion\":false,\"asker\":{\"id\":\"VXNlckAwOjQyMDQ4MTYyMg==\",\"__typename\":\"User\",\"isEmployee\":false,\"uid\":420481622},\"network\":{\"nid\":0,\"id\":\"TmV0d29yazow\"},\"tribeItem\":null},{\"id\":\"UXVlc3Rpb25AMDo1ODA0Mjk2Mg==\",\"__typename\":\"Question\",\"qid\":58042962,\"url\":\"/When-are-nested-functions-in-JavaScript-an-acceptable-use-and-when-should-they-be-avoided\",\"slug\":\"When-are-nested-functions-in-JavaScript-an-acceptable-use-and-when-should-they-be-avoided\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"When are nested functions in JavaScript an acceptable use, and when should they be avoided?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"isPartnerQuestion\":false,\"isTrendyQuestion\":false,\"isFollowUpQuestion\":false,\"asker\":{\"id\":\"VXNlckAwOjY0MDc4OTgw\",\"__typename\":\"User\",\"isEmployee\":false,\"uid\":64078980},\"network\":{\"nid\":0,\"id\":\"TmV0d29yazow\"},\"tribeItem\":null}],\"id\":\"Qm90dG9tUmVsYXRlZFF1ZXN0aW9uc0luZm9AMDozMjM1OTI2X2JvdHRvbV9saW5rcw==\",\"__typename\":\"BottomRelatedQuestionsInfo\",\"hashSuffix\":\"1401036301\"},\"canSeeProgrammaticAds\":true,\"mixRankedAnswersCount\":35,\"googleProgrammaticAdsInfo\":{\"targetingKeyValuePairs\":\"{\\\"subdomain\\\": \\\"en\\\", \\\"placement_type\\\": \\\"question_right_rail\\\"}\",\"behavior\":null,\"apsPubId\":\"0801e0e1-ab8d-4441-983e-ca2c18307829\",\"placementType\":\"question_right_rail\",\"pageTargetingValues\":null,\"googleProgrammaticAds\":[{\"googleProgrammaticAdId\":\"div-gpt-ad-1558733947632-0\",\"slotName\":\"/21680945556/lo_stick_questions_and_ad_react\",\"sizes\":\"[[300, 250]]\",\"refreshIntervalSeconds\":60,\"maxRotation\":10,\"id\":\"R29vZ2xlUHJvZ3JhbW1hdGljQWRAMDpnb29nbGVfcHJvZ3JhbW1hdGljX2FkLTEtTm9uZS0wLTAtMC1Ob25l\"},{\"googleProgrammaticAdId\":\"div-gpt-ad-1637948690403-0\",\"slotName\":\"/21680945556/lo_stick_questions_and_ad_react_2\",\"sizes\":\"[[300, 250]]\",\"refreshIntervalSeconds\":60,\"maxRotation\":10,\"id\":\"R29vZ2xlUHJvZ3JhbW1hdGljQWRAMDpnb29nbGVfcHJvZ3JhbW1hdGljX2FkLTEtTm9uZS0wLTAtMS1Ob25l\"}],\"id\":\"R29vZ2xlUHJvZ3JhbW1hdGljQWRzSW5mb0AwOmdvb2dsZV9wcm9ncmFtbWF0aWNfYWRzLTEtTm9uZS0wLTAtTm9uZQ==\"},\"rightHandSideRelatedQuestionsInfo\":{\"relatedQuestions\":[{\"id\":\"UXVlc3Rpb25AMDo2MTA4MDg3Ng==\",\"__typename\":\"Question\",\"qid\":61080876,\"url\":\"/What-are-arrow-functions-in-JavaScript\",\"slug\":\"What-are-arrow-functions-in-JavaScript\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"What are arrow functions in JavaScript?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"isPartnerQuestion\":false,\"isTrendyQuestion\":false,\"isFollowUpQuestion\":false,\"asker\":{\"id\":\"VXNlckAwOjcxOTUyMjcy\",\"__typename\":\"User\",\"isEmployee\":false,\"uid\":71952272},\"network\":{\"nid\":0,\"id\":\"TmV0d29yazow\"},\"tribeItem\":null},{\"id\":\"UXVlc3Rpb25AMDoxODM0NTM4OTY=\",\"__typename\":\"Question\",\"qid\":183453896,\"url\":\"/How-can-you-implement-a-debounce-function-in-JavaScript\",\"slug\":\"How-can-you-implement-a-debounce-function-in-JavaScript\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"How can you implement a debounce function in JavaScript?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"isPartnerQuestion\":false,\"isTrendyQuestion\":false,\"isFollowUpQuestion\":false,\"asker\":{\"id\":\"VXNlckAwOjIxMDk5OTg5NDY=\",\"__typename\":\"User\",\"isEmployee\":false,\"uid\":2109998946},\"network\":{\"nid\":0,\"id\":\"TmV0d29yazow\"},\"tribeItem\":null},{\"id\":\"UXVlc3Rpb25AMDo4OTM1Mzcz\",\"__typename\":\"Question\",\"qid\":8935373,\"url\":\"/When-why-is-the-bind-function-used-in-JavaScript\",\"slug\":\"When-why-is-the-bind-function-used-in-JavaScript\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"When/why is the bind() function used in JavaScript?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"isPartnerQuestion\":false,\"isTrendyQuestion\":false,\"isFollowUpQuestion\":false,\"asker\":{\"id\":\"VXNlckAwOjIyMTAwMTE1Mw==\",\"__typename\":\"User\",\"isEmployee\":false,\"uid\":221001153},\"network\":{\"nid\":0,\"id\":\"TmV0d29yazow\"},\"tribeItem\":null},{\"id\":\"UXVlc3Rpb25AMDozMzI3NjAwOA==\",\"__typename\":\"Question\",\"qid\":33276008,\"url\":\"/What-is-equivalent-to-callbacks-from-JavaScript-in-other-programming-languages\",\"slug\":\"What-is-equivalent-to-callbacks-from-JavaScript-in-other-programming-languages\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"What is equivalent to callbacks from JavaScript in other programming languages?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"isPartnerQuestion\":false,\"isTrendyQuestion\":false,\"isFollowUpQuestion\":false,\"asker\":{\"id\":\"VXNlckAwOjQ3ODE0MDQ4\",\"__typename\":\"User\",\"isEmployee\":false,\"uid\":47814048},\"network\":{\"nid\":0,\"id\":\"TmV0d29yazow\"},\"tribeItem\":null},{\"id\":\"UXVlc3Rpb25AMDo1NDI0Mjg3\",\"__typename\":\"Question\",\"qid\":5424287,\"url\":\"/What-are-callbacks-and-why-are-they-so-important-in-Javascript\",\"slug\":\"What-are-callbacks-and-why-are-they-so-important-in-Javascript\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"What are callbacks and why are they so important in Javascript?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"isPartnerQuestion\":false,\"isTrendyQuestion\":false,\"isFollowUpQuestion\":false,\"asker\":{\"id\":\"VXNlckAwOjIyMTAwMTE1Mw==\",\"__typename\":\"User\",\"isEmployee\":false,\"uid\":221001153},\"network\":{\"nid\":0,\"id\":\"TmV0d29yazow\"},\"tribeItem\":null},{\"id\":\"UXVlc3Rpb25AMDoxODg1NjU4NQ==\",\"__typename\":\"Question\",\"qid\":18856585,\"url\":\"/What-are-the-intuitive-explanation-for-Javascript-bind-apply-and-call-functions\",\"slug\":\"What-are-the-intuitive-explanation-for-Javascript-bind-apply-and-call-functions\",\"title\":\"{\\\"sections\\\": [{\\\"spans\\\": [{\\\"text\\\": \\\"What are the intuitive explanation for Javascript bind, apply and call functions?\\\", \\\"modifiers\\\": {}}], \\\"indent\\\": 0, \\\"quoted\\\": false, \\\"type\\\": \\\"plain\\\", \\\"is_rtl\\\": false}]}\",\"isPartnerQuestion\":false,\"isTrendyQuestion\":false,\"isFollowUpQuestion\":false,\"asker\":{\"id\":\"VXNlckAwOjE4OTMzMTQyMQ==\",\"__typename\":\"User\",\"isEmployee\":false,\"uid\":189331421},\"network\":{\"nid\":0,\"id\":\"TmV0d29yazow\"},\"tribeItem\":null}],\"id\":\"UmlnaHRIYW5kU2lkZVJlbGF0ZWRRdWVzdGlvbnNJbmZvQDA6MzIzNTkyNl9yaHNfbGlua3M=\",\"__typename\":\"RightHandSideRelatedQuestionsInfo\",\"hashSuffix\":\"-1254905568\"}},\"redirectedQuestion\":null,\"viewer\":{\"id\":\"Vmlld2VyQDA6MA==\",\"__typename\":\"Viewer\",\"canSeeDeletedContent\":false,\"questionExpandGoogleAdAvailable\":false,\"user\":null,\"consumerBundleSubscription\":null,\"hasPoeAccount\":false,\"canReviewAnswers\":false,\"isEnrolledInPromotedAnswerHoldout\":false,\"getCommentAdsExperimentVariant\":null,\"draftsCount\":0,\"answerDraftsCount\":0,\"writeNavBadgeCount\":0,\"appBadgeCount\":0,\"feedTabBadgeCount\":0,\"followingTabBadgeCount\":0,\"inboxBadgeCount\":0,\"notificationNavBadgeCount\":0,\"profileBadgeCount\":0,\"silosBadgeCount\":\"{}\",\"tribeNavBadgeCount\":0,\"useProfileDotForBadgeCount\":false,\"isAdminMode\":false,\"cantAnswerButtonShouldShowText\":true,\"hideLastActionBarItem\":false},\"network\":{\"id\":\"TmV0d29yazow\",\"__typename\":\"Network\",\"contentLanguageCode\":\"en\"},\"judge\":{\"profileUrl\":\"/profile/None\",\"id\":\"VXNlckAwOjA=\",\"uid\":0,\"__typename\":\"User\",\"useTranslatedName\":false,\"isMachineAnswerBot\":false,\"names\":[],\"adminNames\":[]}},\"extensions\":{\"is_final\":true}}");window.ansFrontendGlobals.data.inlineQueryResults.next["850daab2baff19366fcf944d2cc51f3814196d37041b5f5355b06c3d9fbc66e1"] && window.ansFrontendGlobals.data.inlineQueryResults.next["850daab2baff19366fcf944d2cc51f3814196d37041b5f5355b06c3d9fbc66e1"]();