{"json_modified": "2015-04-18T00:38:28.398607", "slug": "Web/JavaScript/Reference/Operators/Logical_Operators", "tags": [], "locale": "zh-CN", "title": "\u903b\u8f91\u8fd0\u7b97\u7b26", "translations": [{"title": "\u8ad6\u7406\u6f14\u7b97\u5b50", "url": "/ja/docs/Web/JavaScript/Reference/Operators/Logical_Operators", "tags": [], "summary": "\u8ad6\u7406\u6f14\u7b97\u5b50 (Logical operators) \u306f\u3001\u57fa\u672c\u7684\u306b\u771f\u507d\uff08\u8ad6\u7406\uff09\u5024\u3068\u3068\u3082\u306b\u7528\u3044\u3089\u308c\u307e\u3059\u3002\u305d\u306e\u3068\u304d\u306f\u3001\u771f\u507d\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002\u3057\u304b\u3057\u3001&&
\u304a\u3088\u3073 ||
\u6f14\u7b97\u5b50\u306f\u3001\u5b9f\u969b\u306b\u306f\u3001\u6307\u5b9a\u3055\u308c\u305f\u6f14\u7b97\u5bfe\u8c61\u306e\u4e00\u65b9\u3092\u8fd4\u3057\u307e\u3059\u3002\u3067\u3059\u304b\u3089\u3001\u305d\u308c\u3089\u306e\u6f14\u7b97\u5b50\u304c\u3001\u771f\u507d\u5024\u3067\u306f\u306a\u3044\u5024\u3068\u3068\u3082\u306b\u7528\u3044\u3089\u308c\u305f\u5834\u5408\u3001\u771f\u507d\u5024\u3067\u306f\u306a\u3044\u5024\u3092\u8fd4\u3059\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002", "localization_tags": [], "locale": "ja", "last_edit": "2015-04-15T07:57:54", "review_tags": []}, {"title": "Logical Operators", "url": "/en-US/docs/Web/JavaScript/Reference/Operators/Logical_Operators", "tags": ["Operator", "JavaScript"], "summary": "Logical operators are typically used with Boolean
(logical) values. When they are, they return a Boolean value. However, the &&
and ||
operators actually return the value of one of the specified operands, so if these operators are used with non-Boolean values, they may return a non-Boolean value.", "localization_tags": [], "locale": "en-US", "last_edit": "2015-04-11T10:07:43", "review_tags": []}, {"title": "Op\u00e9rateurs logiques", "url": "/fr/docs/Web/JavaScript/Reference/Op%C3%A9rateurs/Op%C3%A9rateurs_logiques", "tags": ["R\u00e9f\u00e9rence", "Reference", "R\u00e9ference", "Operator", "JavaScript"], "summary": "Les op\u00e9rateurs logiques sont typiquement utilis\u00e9s avec des valeurs bool\u00e9ennes (logiques)\u00a0; lorsque c'est le cas, ils renvoient une valeur bool\u00e9enne \u00e9galement. Cependant, les op\u00e9rateurs &&
et ||
renvoient en r\u00e9alit\u00e9 la valeur d'un des op\u00e9randes sp\u00e9cifi\u00e9s. Si ces op\u00e9rateurs sont utilis\u00e9s avec des valeurs non bool\u00e9ennes, ils peuvent donc \u00e9galement renvoyer une valeur non bool\u00e9enne.", "localization_tags": [], "locale": "fr", "last_edit": "2015-04-11T13:20:33", "review_tags": []}, {"title": "Operadores L\u00f3gicos", "url": "/pt-BR/docs/Web/JavaScript/Reference/Operators/Operadores_Logicos", "tags": [], "summary": "Operadores l\u00f3gicos s\u00e3o tipicamente usados com valores Booleanos
(l\u00f3gicos). Quando eles o s\u00e3o, retornam um valor booleano. Por\u00eam, os operadores &&
e ||
atualmente retornam o valor de um dos operandos especificos, ent\u00e3o seesses operadores s\u00e3ousados com valores n\u00e3o booleanos, eles podem retornar um valor n\u00e3o booleano.", "localization_tags": ["inprogress"], "locale": "pt-BR", "last_edit": "2014-11-19T11:48:56", "review_tags": []}, {"title": "Operadors L\u00f2gics", "url": "/ca/docs/Web/JavaScript/Referencia/Operadors/Logical_Operators", "tags": [], "summary": "Els operadors l\u00f2gics s'utilitzen normalment amb valors Boolean
(l\u00f2gics). En cas de serh-hi presents, retornen un valor boole\u00e0. Tot i aix\u00ed, els operadors &&
i ||
retornen el valor d'un dels operands especificats, aix\u00ed que si aquests operadors es fan servir amb valors no booleans, poden retornar un valor no boole\u00e0.", "localization_tags": [], "locale": "ca", "last_edit": "2015-03-09T06:26:23", "review_tags": []}], "modified": "2015-04-18T00:38:25", "label": "\u903b\u8f91\u8fd0\u7b97\u7b26", "localization_tags": [], "url": "/zh-CN/docs/Web/JavaScript/Reference/Operators/Logical_Operators", "last_edit": "2015-01-05T05:59:05", "summary": "
\u903b\u8f91\u8fd0\u7b97\u7b26\u901a\u5e38\u7528\u4e8e\u5e03\u5c14\u578b\uff08\u903b\u8f91\uff09\u503c\uff1b\u8fd9\u79cd\u60c5\u51b5\uff0c\u5b83\u4eec\u8fd4\u56de\u4e00\u4e2a\u5e03\u5c14\u578b\u503c\u3002\u7136\u800c\uff0c&&\u548c||\u8fd0\u7b97\u7b26\u5b9e\u9645\u4e0a\u8fd4\u56de\u4e00\u4e2a\u6307\u5b9a\u64cd\u4f5c\u6570\u7684\u503c\uff0c\u56e0\u6b64\u8fd9\u4e9b\u8fd0\u7b97\u7b26\u4e5f\u7528\u4e8e\u975e\u5e03\u5c14\u578b\uff0c\u5b83\u4eec\u8fd4\u56de\u4e00\u4e2a\u975e\u5e03\u5c14\u578b\u503c\u3002", "sections": [{"id": "Quick_Links", "title": "JavaScript \u6559\u7a0b: JavaScript \u6307\u5357 Introduction Grammar and types Control flow and error handling Loops and iteration Functions Expressions and operators Numbers and dates Text formatting Regular expressions Indexed collections Keyed collections Working with objects Details of the object model Iterators and generators Meta programming \u5feb\u901f\u5165\u95e8 JavaScript \u57fa\u7840\u77e5\u8bc6 JavaScript \u77e5\u8bc6\u6982\u8981 Javascript \u9762\u5411\u5bf9\u8c61\u7f16\u7a0b \u4e2d\u7ea7\u6559\u7a0b \u6df1\u5165 JavaScript JavaScript \u6570\u636e\u7ed3\u6784 \u5982\u4f55\u6b63\u786e\u5224\u65ad\u76f8\u7b49\u6027 Closures \u9ad8\u7ea7 \u7ee7\u627f\u548c\u539f\u578b\u94fe \u4e25\u683c\u6a21\u5f0f JavaScript \u7c7b\u578b\u5316\u6570\u7ec4 \u5185\u5b58\u7ba1\u7406 Concurrency model and Event Loop \u5f15\u7528: \u5185\u7f6e\u5bf9\u8c61 JavaScript \u6807\u51c6\u5e93 Array ArrayBuffer Boolean DataView [Translate] Date Error EvalError Float32Array [Translate] Float64Array [Translate] Function Generator [Translate] GeneratorFunction [Translate] Infinity Int16Array [Translate] Int32Array [Translate] Int8Array [Translate] InternalError [Translate] Intl [Translate] Intl.Collator [Translate] Intl.DateTimeFormat [Translate] Intl.NumberFormat [Translate] Iterator [Translate] JSON Map Math NaN Number Object ParallelArray Promise Proxy RangeError [Translate] ReferenceError [Translate] Reflect [Translate] RegExp Set StopIteration [Translate] String Symbol SyntaxError TypeError [Translate] TypedArray URIError [Translate] Uint16Array [Translate] Uint32Array Uint8Array [Translate] Uint8ClampedArray [Translate] WeakMap WeakSet decodeURI decodeURIComponent() encodeURI() encodeURIComponent() escape() eval() isFinite() isNaN() null parseFloat parseInt undefined unescape() [Translate] uneval() [Translate] \u8868\u8fbe\u5f0f\u548c\u8fd0\u7b97\u7b26 \u8fd0\u7b97\u7b26 \u7b97\u672f\u8fd0\u7b97\u7b26 \u6570\u7ec4\u63a8\u5bfc\u5f0f \u8d4b\u503c\u8fd0\u7b97\u7b26 \u6309\u4f4d\u64cd\u4f5c\u7b26 \u9017\u53f7\u64cd\u4f5c\u7b26 Comparison operators [Translate] Conditional (ternary) Operator [Translate] \u89e3\u6784\u8d4b\u503c\uff08Destructuring assignment\uff09 Expression closures [Translate] Generator comprehensions [Translate] \u5706\u62ec\u53f7\u8fd0\u7b97\u7b26 Legacy generator function expression [Translate] \u903b\u8f91\u8fd0\u7b97\u7b26 Object initializer [Translate] \u8fd0\u7b97\u7b26\u4f18\u5148\u7ea7 Property accessors [Translate] \u5c55\u5f00\u8fd0\u7b97\u7b26 class expression [Translate] delete \u51fd\u6570\u8868\u8fbe\u5f0f function* expression [Translate] in instanceof new\u8fd0\u7b97\u7b26 super this typeof void \u8fd0\u7b97\u7b26 yield yield* \u8bed\u53e5\u548c\u58f0\u660e Statements Legacy generator function [Translate] block break class [Translate] const continue debugger do...while empty export [Translate] for [Translate] for each...in for...in for...of function \u751f\u6210\u5668\uff08generator\uff09 if...else import [Translate] label let return switch throw try...catch [Translate] var while with \u51fd\u6570 \u51fd\u6570\u548c\u51fd\u6570\u4f5c\u7528\u57df arguments \u7bad\u5934\u51fd\u6570 \u9ed8\u8ba4\u53c2\u6570\u503c \u65b9\u6cd5\u7684\u5b9a\u4e49 \u5269\u4f59\u53c2\u6570 getter setter Classes Classes [Translate] constructor [Translate] extends [Translate] static [Translate] \u66f4\u591a \u8bcd\u6cd5\u6587\u6cd5 JavaScript \u6570\u636e\u7ed3\u6784 \u5c5e\u6027\u7684\u53ef\u679a\u4e3e\u6027\u548c\u6240\u6709\u6743 Iteration protocols \u4e25\u683c\u6a21\u5f0f \u5207\u6362\u5230\u4e25\u683c\u6a21\u5f0f \u6a21\u677f\u5b57\u7b26\u4e32 \u5df2\u5e9f\u5f03\u7684\u7279\u6027 New in JavaScript New in JavaScript Mozilla\u5bf9ECMAScript 5\u7684\u652f\u6301 Firefox \u4e2d ECMAScript 6 \u7684\u5b9e\u73b0\u60c5\u51b5 ECMAScript 7 support in Mozilla [Translate] Firefox JavaScript changelog [Translate] New in JavaScript 1.1 [Translate] New in JavaScript 1.2 [Translate] New in JavaScript 1.3 [Translate] New in JavaScript 1.4 [Translate] JavaScript 1.5 \u7684\u65b0\u7279\u6027 JavaScript 1.6 \u7684\u65b0\u7279\u6027 New in JavaScript 1.7 New in JavaScript 1.8 New in JavaScript 1.8.1 [Translate] JavaScript 1.8.5 \u7684\u65b0\u7279\u6027 \u6587\u6863: \u5e38\u7528\u5217\u8868 \u5168\u90e8\u9875\u9762\u7d22\u5f15 \u65b9\u6cd5\u7d22\u5f15 \u5c5e\u6027\u7d22\u5f15 \u62e5\u6709 \"JavaScript\" \u6807\u7b7e\u7684\u9875\u9762 \u8d21\u732e JavaScript \u6587\u6863\u7ffb\u8bd1\u72b6\u6001 MDN \u9879\u76ee"}, {"id": ".E6.91.98.E8.A6.81", "title": "\u6458\u8981"}, {"id": ".E6.8F.8F.E8.BF.B0", "title": "\u63cf\u8ff0"}, {"id": "Short-Circuit_Evaluation", "title": "\u77ed\u8def\u8ba1\u7b97"}, {"id": ".E9.80.BB.E8.BE.91.E4.B8.8E_(.26.26)", "title": "\u903b\u8f91\u4e0e (&&)"}, {"id": ".E9.80.BB.E8.BE.91.E6.88.96_(.7C.7C)", "title": "\u903b\u8f91\u6216 (||)"}, {"id": ".E9.80.BB.E8.BE.91.E9.9D.9E_(!)", "title": "\u903b\u8f91\u975e (!)"}, {"id": ".E8.BD.AC.E6.8D.A2.E8.A7.84.E5.88.99", "title": "\u8f6c\u6362\u89c4\u5219"}, {"id": ".E5.B0.86_AND_.E8.BD.AC.E6.8D.A2.E4.B8.BA_OR", "title": "\u5c06 AND \u8f6c\u6362\u4e3a OR"}, {"id": ".E5.B0.86_OR_.E8.BD.AC.E6.8D.A2.E4.B8.BA_AND", "title": "\u5c06 OR \u8f6c\u6362\u4e3a AND"}, {"id": ".E5.88.A0.E9.99.A4.E5.B5.8C.E5.A5.97.E7.9A.84.E5.B0.8F.E6.8B.AC.E5.8F.B7", "title": "\u5220\u9664\u5d4c\u5957\u7684\u5c0f\u62ec\u53f7"}, {"id": ".E5.88.A0.E9.99.A4.E5.B5.8C.E5.A5.97.E7.9A.84_AND", "title": "\u5220\u9664\u5d4c\u5957\u7684 AND"}, {"id": ".E5.88.A0.E9.99.A4.E5.B5.8C.E5.A5.97.E7.9A.84_OR", "title": "\u5220\u9664\u5d4c\u5957\u7684 OR"}, {"id": ".E8.A7.84.E8.8C.83", "title": "\u89c4\u8303"}, {"id": ".E6.B5.8F.E8.A7.88.E5.99.A8.E5.85.BC.E5.AE.B9.E6.80.A7", "title": "\u6d4f\u89c8\u5668\u517c\u5bb9\u6027"}, {"id": "JavaScript_1.0_and_1.1", "title": "\u5411\u540e\u517c\u5bb9: \u5728 JavaScript 1.0 \u548c 1.1 \u4e2d\u7684\u8868\u73b0"}, {"id": "See_also", "title": "\u53c2\u8003\u8d44\u6599"}], "id": 64961, "review_tags": []}