{"id":2706,"date":"2020-05-14T08:39:29","date_gmt":"2020-05-14T05:39:29","guid":{"rendered":"https:\/\/elzero.org\/?p=2706"},"modified":"2021-07-20T21:48:51","modified_gmt":"2021-07-20T18:48:51","slug":"js-break-loop-on-specific-value","status":"publish","type":"post","link":"https:\/\/elzero.org\/old\/js-break-loop-on-specific-value\/","title":{"rendered":"\u0643\u064a\u0641\u064a\u0629 \u0625\u064a\u0642\u0627\u0641 \u0627\u0644 Loop \u0639\u0646\u062f \u0642\u064a\u0645\u0629 \u0645\u0639\u064a\u0646\u0629"},"content":{"rendered":"<div class=\"text\">\r\n\u0633\u0648\u0641 \u0646\u0642\u0648\u0645 \u0628\u0625\u064a\u0642\u0627\u0641 \u0627\u0644\u062d\u0644\u0642\u0629 \u0627\u0644\u062a\u0643\u0631\u0627\u0631\u064a\u0629 \u0639\u0646\u062f \u0627\u0644\u0648\u0635\u0648\u0644 \u0644\u0639\u0646\u0635\u0631 \u0645\u0639\u064a\u0646 \u062f\u0627\u062e\u0644\u0647\u0627 \u0628\u0633\u0647\u0648\u0644\u0629 \u0634\u062f\u064a\u062f\u0629 \u0628\u0648\u0627\u0633\u0637\u0629 <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Statements\/break\" rel=\"noopener\" target=\"_blank\">Break<\/a> \u0648\u0633\u0648\u0641 \u0646\u0642\u0648\u0645 \u0628\u0627\u0644\u062a\u062c\u0631\u0628\u0629 \u0628\u0648\u0627\u0633\u0637\u0629 For Loop \r\n<\/div>\r\n\r\n<div class=\"text\">\r\n\u0644\u0627\u062d\u0638 \u0645\u0639\u064a \u0644\u0648 \u0642\u0645\u0646\u0627 \u0628\u0639\u0645\u0644 \u0627\u0644\u0634\u0631\u0637 \u0623\u0648\u0644\u0627 \u0648\u0628\u0639\u062f\u0647 \u0637\u0628\u0627\u0639\u0629 \u0627\u0644\u0642\u064a\u0645 \u0633\u0648\u0641 \u064a\u0642\u0641 \u0639\u0646\u062f \u0627\u0644\u0642\u064a\u0645\u0629 Eman \u0648\u0644\u0646 \u064a\u0637\u0628\u0639\u0647\u0627\r\n<\/div>\r\n\r\n<script type=\"text\/plain\" class=\"language-javascript\">\r\nvar theNames = [\"Osama\", \"Ahmed\", \"Sayed\", \"Eman\", \"Mahmoud\", \"Khaled\"];\r\n\r\nfor (var i = 0; i < theNames.length; i++) {\r\n  if (theNames[i] === \"Eman\") {\r\n    break;\r\n  }\r\n  console.log(theNames[i]);\r\n}\r\n\r\n\/\/ Output\r\n\"Osama\"\r\n\"Ahmed\"\r\n\"Sayed\"\r\n<\/script>\r\n\r\n<div class=\"text\">\r\n\u0623\u0645\u0627 \u0644\u0648 \u0637\u0628\u0639\u0646\u0627 \u0627\u0644\u0642\u064a\u0645 \u0642\u0628\u0644 \u0627\u0644 Break \u0633\u0648\u0641 \u064a\u0637\u0628\u0639 \u0627\u0644\u0642\u064a\u0645\u0629 \u0648\u064a\u0642\u0648\u0645 \u0628\u0625\u064a\u0642\u0627\u0641 \u0627\u0644 Loop\r\n<\/div>\r\n\r\n<script type=\"text\/plain\" class=\"language-javascript\">\r\nvar theNames = [\"Osama\", \"Ahmed\", \"Sayed\", \"Eman\", \"Mahmoud\", \"Khaled\"];\r\n\r\nfor (var i = 0; i < theNames.length; i++) {\r\n  console.log(theNames[i]);\r\n  if (theNames[i] === \"Eman\") {\r\n    break;\r\n  }\r\n}\r\n\r\n\/\/ Output\r\n\"Osama\"\r\n\"Ahmed\"\r\n\"Sayed\"\r\n\"Eman\"\r\n<\/script>\r\n","protected":false},"excerpt":{"rendered":"<p>\u0643\u064a\u0641\u064a\u0629 \u0625\u064a\u0642\u0627\u0641 \u0627\u0644 Loop \u0639\u0646\u062f \u0642\u064a\u0645\u0629 \u0645\u0639\u064a\u0646\u0629 \u062f\u0627\u062e\u0644 \u0627\u0644 Arrays<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[525],"tags":[573,331,572,574],"class_list":["post-2706","post","type-post","status-publish","format-standard","hentry","category-javascript-tutorials","tag-break","tag-javascript","tag-loop","tag-574"],"_links":{"self":[{"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/posts\/2706","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/comments?post=2706"}],"version-history":[{"count":5,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/posts\/2706\/revisions"}],"predecessor-version":[{"id":8177,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/posts\/2706\/revisions\/8177"}],"wp:attachment":[{"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/media?parent=2706"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/categories?post=2706"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/tags?post=2706"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}