{"id":418,"date":"2014-06-06T10:19:10","date_gmt":"2014-06-06T10:19:10","guid":{"rendered":"http:\/\/localhost\/__sites\/3d_blog\/?p=418"},"modified":"2014-06-07T17:55:21","modified_gmt":"2014-06-07T17:55:21","slug":"javascript-if-in-other-form","status":"publish","type":"post","link":"https:\/\/blog.silverterra.net\/?p=418","title":{"rendered":"javascript <span class='red'>if function<\/span> &#8211; created on other way"},"content":{"rendered":"<blockquote><p>Goal: to go out of box&#8230;<\/p><\/blockquote>\n<p>The if construction is simple<\/p>\n<pre data-enlighter-language=\"js\" class=\"EnlighterJSRAW\">\r\nif(someThing == 'value'){\r\n  $(this).stop().animate({'opacity':0}, 250);\r\n  this.obj.isHidden = true;\r\n}\r\n<\/pre>\n<p>Meanwhile I use the following for in many cases:<\/p>\n<pre data-enlighter-language=\"js\" class=\"EnlighterJSRAW\">\r\nsomeThing == 'value' &amp;&amp; (\r\n  $(this).stop().animate({'opacity':0}, 250),\r\n  this.obj.isHidden = true\r\n);\r\n<\/pre>\n<p><span class=\"red\"><strong>But!<\/strong> Never use return from the comma chain!<\/span><br \/>\n<code data-enlighter-language=\"js\" class=\"EnlighterJSRAW\"><\/code><br \/>\nsomeThing == 'value' && (<br \/>\n  $(this).stop().animate({'opacity':0}, 250),<br \/>\n  this.obj.isHidden = true,<br \/>\n  return true;  \/* <-- NEVER! *\/\n);\nreturn false;\n[\/js]\n\n\njust good to know...\n<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Goal: to go out of box&#8230; The if construction is simple Meanwhile I use the following for in many cases: But! Never use return from the comma chain! someThing == &#8216;value&#8217; &#038;&#038; ( $(this).stop().animate({&#8216;opacity&#8217;:0}, 250), this.obj.isHidden = true, return true; \/*<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-418","post","type-post","status-publish","format-standard","hentry","category-javascript"],"_links":{"self":[{"href":"https:\/\/blog.silverterra.net\/index.php?rest_route=\/wp\/v2\/posts\/418","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.silverterra.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.silverterra.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.silverterra.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.silverterra.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=418"}],"version-history":[{"count":14,"href":"https:\/\/blog.silverterra.net\/index.php?rest_route=\/wp\/v2\/posts\/418\/revisions"}],"predecessor-version":[{"id":437,"href":"https:\/\/blog.silverterra.net\/index.php?rest_route=\/wp\/v2\/posts\/418\/revisions\/437"}],"wp:attachment":[{"href":"https:\/\/blog.silverterra.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=418"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.silverterra.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=418"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.silverterra.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=418"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}