{"json_modified": "2015-04-26T06:11:17.528235", "slug": "Web/JavaScript/Guide/Functions", "tags": [], "locale": "ca", "title": "Funcions", "translations": [{"title": "Functions", "url": "/en-US/docs/Web/JavaScript/Guide/Functions", "tags": ["Guide", "Functions", "Beginner", "JavaScript"], "summary": "Functions are one of the fundamental building blocks in JavaScript. A function is a JavaScript procedure\u2014a set of statements that performs a task or calculates a value. To use a function, you must define it somewhere in the scope from which you wish to call it.", "localization_tags": [], "locale": "en-US", "last_edit": "2015-04-22T03:01:30", "review_tags": []}, {"title": "\u95a2\u6570", "url": "/ja/docs/Web/JavaScript/Guide/Functions", "tags": ["MDC Project", "Functions", "NeedsMarkupWork", "JavaScript"], "summary": "\u95a2\u6570\u306f\u3001JavaScript \u306e\u57fa\u672c\u7684\u306a\u69cb\u6210\u8981\u7d20\u306e\u3072\u3068\u3064\u3067\u3059\u3002\u307e\u305f\u95a2\u6570\u306f\u3001JavaScript \u306e\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u3067\u3059\u3002\u3064\u307e\u308a\u3001\u30bf\u30b9\u30af\u3084\u5024\u306e\u8a08\u7b97\u3092\u5b9f\u884c\u3059\u308b\u6587\u306e\u96c6\u307e\u308a\u3067\u3059\u3002\u95a2\u6570\u3092\u4f7f\u3046\u306b\u306f\u3001\u305d\u308c\u3092\u547c\u3073\u51fa\u3057\u305f\u3044\u30b9\u30b3\u30fc\u30d7\u5185\u306e\u3069\u3053\u304b\u3067\u5b9a\u7fa9\u3057\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002", "localization_tags": [], "locale": "ja", "last_edit": "2013-05-28T13:01:44", "review_tags": []}, {"title": "\u0424\u0443\u043d\u043a\u0446\u0438\u0438", "url": "/ru/docs/Web/JavaScript/Guide/Functions", "tags": [], "summary": "\u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u044d\u0442\u043e \u043e\u0434\u0438\u043d \u0438\u0437 \u0444\u0443\u043d\u0434\u0430\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u0442\u0440\u043e\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0431\u043b\u043e\u043a\u043e\u0432 JavaScript. \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u044d\u0442\u043e JavaScript \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0430\u044f \u0441\u043e\u0431\u043e\u0439 \u043d\u0430\u0431\u043e\u0440 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442 \u043a\u0430\u043a\u043e\u0435 \u043b\u0438\u0431\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0438\u043b\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u044e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. \u0427\u0442\u043e\u0431\u044b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439, \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432 \u0442\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0433\u0434\u0435 \u0445\u043e\u0442\u0438\u0442\u0435 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0435\u0435.", "localization_tags": ["inprogress"], "locale": "ru", "last_edit": "2015-04-22T07:25:08", "review_tags": []}, {"title": "\u51fd\u6570", "url": "/zh-CN/docs/Web/JavaScript/Guide/Functions", "tags": ["\u51fd\u6570", "JavaScript"], "summary": "\u51fd\u6570\u662f\u642d\u5efaJavaScript\u8bed\u8a00\u5927\u53a6\u7684\u57fa\u672c\u6784\u4ef6\u4e4b\u4e00\u3002\u4e00\u4e2a\u51fd\u6570\u672c\u8eab\u5c31\u662f\u4e00\u6bb5JavaScript\u7a0b\u5e8f\u2014\u2014\u5305\u542b\u7528\u4e8e\u6267\u884c\u67d0\u4e00\u4efb\u52a1\u6216\u8ba1\u7b97\u7684\u4e00\u7cfb\u5217\u8bed\u53e5\u3002\u8981\u4f7f\u7528\u67d0\u4e00\u4e2a\u51fd\u6570\uff0c\u4f60\u5fc5\u9700\u5728\u60f3\u8981\u8c03\u7528\u8fd9\u4e2a\u51fd\u6570\u7684\u6267\u884c\u57df\u7684\u67d0\u5904\u5b9a\u4e49\u5b83\u3002", "localization_tags": [], "locale": "zh-CN", "last_edit": "2015-04-07T08:02:02", "review_tags": []}, {"title": "Funktionen", "url": "/de/docs/Web/JavaScript/Guide/Funktionen", "tags": ["Guide", "Beginner", "JavaScript"], "summary": "Functions are one of the fundamental building blocks in JavaScript. A function is a JavaScript procedure\u2014a set of statements that performs a task or calculates a value. To use a function, you must define it somewhere in the scope from which you wish to call it.", "localization_tags": ["inprogress"], "locale": "de", "last_edit": "2015-04-22T04:16:02", "review_tags": []}, {"title": "Funciones", "url": "/es/docs/Web/JavaScript/Guide/Funciones", "tags": [], "summary": "Las funciones son uno de los pilares fundamentales en JavaScript. Una funci\u00f3n es un procedimiento JavaScript\u2014un conjunto de declaraciones que realiza una tarea o calcula un valor. Para usar una funci\u00f3n, debes definirla en alg\u00fan lugar del \u00e1mbito desde el cual deseas llamarla.", "localization_tags": [], "locale": "es", "last_edit": "2015-03-05T17:41:09", "review_tags": []}, {"title": "Fonctions", "url": "/fr/docs/Web/JavaScript/Guide/Fonctions", "tags": ["Guide", "Functions", "Beginner", "JavaScript"], "summary": "Les fonctions font partie des briques fondamentales de JavaScript. Une fonction est une proc\u00e9dure JavaScript, un ensemble d'instructions effectuant une t\u00e2che ou calculant une valeur. Afin d'utiliser une fonction, il est n\u00e9cessaire de l'avoir auparavant d\u00e9finie au sein de la port\u00e9e dans laquelle on souhaite l'appeler.", "localization_tags": [], "locale": "fr", "last_edit": "2015-04-25T09:45:19", "review_tags": []}, {"title": "\u09ab\u09be\u0982\u09b6\u09a8", "url": "/bn-BD/docs/Web/JavaScript/Guide/Functions", "tags": ["Guide", "JavaScript"], "summary": "\u09ab\u09be\u0982\u09b6\u09a8 \u09b9\u099a\u09cd\u099b\u09c7 \u099c\u09be\u09ad\u09be\u09b8\u09cd\u0995\u09cd\u09b0\u09bf\u09aa\u09cd\u099f\u09c7\u09b0 \u0985\u09a8\u09cd\u09af\u09a4\u09ae \u09ac\u09bf\u09b2\u09cd\u09a1\u09bf\u0982 \u09ac\u09cd\u09b2\u0995\u0964 \u09ab\u09be\u0982\u09b6\u09a8 \u09b9\u099a\u09cd\u099b\u09c7\u0983 \u0995\u09bf\u099b\u09c1 \u09b8\u09cd\u099f\u09c7\u099f\u09ae\u09c7\u09a8\u09cd\u099f \u09af\u09c7\u0997\u09c1\u09b2\u09cb execute \u09b9\u09ac\u09c7, \u09af\u09be\u09b0 \u09ae\u09be\u09a7\u09cd\u09af\u09ae\u09c7 \u0986\u09aa\u09a8\u09bf \u0995\u09cb\u09a8 \u0995\u09be\u099c \u0995\u09b0\u09ac\u09c7\u09a8 \u0985\u09a5\u09ac\u09be \u0995\u09cb\u09a8 \u09ae\u09be\u09a8 \u09a8\u09bf\u09b0\u09cd\u09a3\u09df \u0995\u09b0\u09ac\u09c7\u09a8\u0964 \u09ab\u09be\u0982\u09b6\u09a8 \u09ac\u09cd\u09af\u09ac\u09b9\u09be\u09b0 \u0995\u09b0\u09be\u09b0 \u099c\u09a8\u09cd\u09af \u0986\u09aa\u09a8\u09bf \u09af\u09c7\u0987 \u09b8\u09cd\u0995\u09cb\u09aa \u09a5\u09c7\u0995\u09c7 \u09ab\u09be\u0982\u09b6\u09a8 \u0995\u09b2 \u0995\u09b0\u09ac\u09c7\u09a8, \u09b8\u09c7\u0996\u09be\u09a8\u09c7 \u09ab\u09be\u0982\u09b6\u09a8\u099f\u09bf \u09b2\u09bf\u0996\u09a4\u09c7 \u09b9\u09ac\u09c7 (\u09a1\u09bf\u09ab\u09be\u0987\u09a8 \u0995\u09b0\u09a4\u09c7 \u09b9\u09ac\u09c7)\u0964", "localization_tags": ["inprogress"], "locale": "bn-BD", "last_edit": "2015-04-26T05:04:04", "review_tags": []}, {"title": "\u51fd\u5f0f", "url": "/zh-TW/docs/Web/JavaScript/Guide/Functions", "tags": [], "summary": "\u51fd\u5f0f\u662f\u69cb\u6210javascript\u7684\u57fa\u672c\u8981\u7d20\u4e4b\u4e00\u3002\u4e00\u500b\u51fd\u5f0f\u672c\u8eab\u5c31\u662f\u4e00\u6bb5JavaScript\u7a0b\u5e8f\u2014\u5305\u542b\u7528\u65bc\u57f7\u884c\u67d0\u4e00\u500b\u4efb\u52d9\u6216\u8a08\u7b97\u7684\u8a9e\u6cd5\u3002\u8981\u547c\u53eb\u67d0\u4e00\u500b\u51fd\u5f0f\u4e4b\u524d\uff0c\u4f60\u5fc5\u9700\u5148\u5728\u9019\u500b\u51fd\u5f0f\u6b32\u57f7\u884c\u7684scope\u4e2d\u5b9a\u7fa9\u5b83\u3002", "localization_tags": [], "locale": "zh-TW", "last_edit": "2014-07-04T07:14:09", "review_tags": []}, {"title": "Functions", "url": "/th/docs/Web/JavaScript/Guide/Functions", "tags": [], "summary": "\u0e1f\u0e31\u0e07\u0e01\u0e4c\u0e0a\u0e31\u0e19\u0e40\u0e1b\u0e47\u0e19\u0e2b\u0e19\u0e36\u0e48\u0e07\u0e43\u0e19\u0e2a\u0e48\u0e27\u0e19\u0e1b\u0e23\u0e30\u0e01\u0e2d\u0e1a\u0e2b\u0e25\u0e31\u0e01\u0e02\u0e2d\u0e07\u0e08\u0e32\u0e27\u0e32\u0e2a\u0e04\u0e23\u0e34\u0e1b\u0e15\u0e4c \u0e2b\u0e19\u0e36\u0e48\u0e07\u0e1f\u0e31\u0e07\u0e01\u0e4c\u0e0a\u0e31\u0e19\u0e04\u0e37\u0e2d\u0e2b\u0e19\u0e36\u0e48\u0e07\u0e01\u0e23\u0e30\u0e1a\u0e27\u0e19\u0e01\u0e32\u0e23\u0e02\u0e2d\u0e07\u0e08\u0e32\u0e27\u0e32\u0e2a\u0e04\u0e23\u0e34\u0e1b\u0e15\u0e4c \u0e0b\u0e36\u0e48\u0e07\u0e01\u0e47\u0e04\u0e37\u0e2d\u0e0a\u0e38\u0e14\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07\u0e17\u0e35\u0e48\u0e17\u0e33\u0e07\u0e32\u0e19\u0e2b\u0e23\u0e37\u0e2d\u0e04\u0e33\u0e19\u0e27\u0e13\u0e04\u0e48\u0e32 \u0e42\u0e14\u0e22\u0e04\u0e38\u0e13\u0e15\u0e49\u0e2d\u0e07\u0e1b\u0e23\u0e30\u0e01\u0e32\u0e28\u0e43\u0e0a\u0e49\u0e1f\u0e31\u0e07\u0e01\u0e4c\u0e0a\u0e31\u0e19\u0e17\u0e35\u0e48\u0e43\u0e14\u0e01\u0e47\u0e44\u0e14\u0e49\u0e20\u0e32\u0e22\u0e43\u0e19\u0e02\u0e2d\u0e1a\u0e40\u0e02\u0e15\u0e17\u0e35\u0e48\u0e04\u0e38\u0e13\u0e40\u0e23\u0e35\u0e22\u0e01\u0e43\u0e0a\u0e49", "localization_tags": ["inprogress"], "locale": "th", "last_edit": "2014-04-02T01:38:09", "review_tags": []}, {"title": "Fun\u00e7\u00f5es", "url": "/pt-BR/docs/Web/JavaScript/Guide/Fun%C3%A7%C3%B5es", "tags": [], "summary": "Functions are one of the fundamental building blocks in JavaScript. A function is a JavaScript procedure\u2014a set of statements that performs a task or calculates a value. To use a function, you must define it somewhere in the scope from which you wish to call it.", "localization_tags": ["inprogress"], "locale": "pt-BR", "last_edit": "2015-01-05T06:00:19", "review_tags": []}], "modified": "2015-04-26T06:11:13", "label": "Funcions", "localization_tags": [], "url": "/ca/docs/Web/JavaScript/Guide/Functions", "last_edit": "2015-04-26T06:11:05", "summary": "Les funcions s\u00f3n uns dels\u00a0blocs de construcci\u00f3 elementals en\u00a0JavaScript. Una funci\u00f3 \u00e9s un procediment de JavaScript\u2014un conjunt de sent\u00e8ncies que performa una tasca o\u00a0calcula un valor. Per tal de fer servir una funci\u00f3,\u00a0primer s'ha de defnir en alguna part de l'\u00e1mbit en que es vol cridar.", "sections": [{"id": "Quick_Links", "title": "JavaScript Tutorials: JavaScript Guide 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 Introductory JavaScript basics JavaScript technologies overview Introduction to Object Oriented JavaScript Intermediate A re-introduction to JavaScript JavaScript data structures Equality comparisons and sameness Closures Advanced Inheritance and the prototype chain Strict mode JavaScript typed arrays Memory Management Concurrency model and Event Loop References: Built-in objects Objectes Standard Array [Translate] ArrayBuffer [Translate] Boolean DataView [Translate] Date Error EvalError [Translate] Float32Array [Translate] Float64Array [Translate] Function [Translate] 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 [Translate] ParallelArray [Translate] Promise [Translate] Proxy [Translate] RangeError [Translate] ReferenceError [Translate] Reflect [Translate] RegExp [Translate] SIMD [Translate] Set [Translate] StopIteration [Translate] String Symbol [Translate] SyntaxError [Translate] TypeError [Translate] TypedArray [Translate] URIError [Translate] Uint16Array [Translate] Uint32Array [Translate] Uint8Array [Translate] Uint8ClampedArray [Translate] WeakMap [Translate] WeakSet [Translate] decodeURI() [Translate] decodeURIComponent() [Translate] encodeURI() [Translate] encodeURIComponent() [Translate] escape() [Translate] eval() [Translate] isFinite() [Translate] isNaN() [Translate] null parseFloat() [Translate] parseInt() [Translate] undefined unescape() [Translate] uneval() [Translate] Expressions & operators Expressions and operators Operadors aritm\u00e8tics Array comprehensions [Translate] Assignment operators Operadors de bits Operador Coma Comparison operators [Translate] Operador Condicional (ternari) Destructuring assignment [Translate] Expression closures [Translate] Generator comprehensions [Translate] Operador d'agrupament Legacy generator function expression [Translate] Operadors L\u00f2gics Object initializer [Translate] Operator precedence [Translate] Property accessors [Translate] Spread operator [Translate] class expression [Translate] Operador delete function expression [Translate] function* expression [Translate] in operator [Translate] instanceof [Translate] new operator [Translate] super this [Translate] typeof L'operador void yield yield* [Translate] Statements & declarations Statements and declarations Legacy generator function [Translate] block break [Translate] class [Translate] const [Translate] continue [Translate] debugger [Translate] do...while [Translate] Buida export [Translate] for for each...in [Translate] for...in [Translate] for...of function function* [Translate] if...else import [Translate] label [Translate] let [Translate] return switch [Translate] throw [Translate] try...catch [Translate] var [Translate] while with [Translate] Functions Functions [Translate] Arguments object [Translate] Arrow functions [Translate] Default parameters [Translate] Method definitions [Translate] Rest parameters [Translate] getter [Translate] setter [Translate] Classes Classes constructor extends [Translate] static Misc Lexical grammar JavaScript data structures Enumerability and ownership of properties Iteration protocols Strict mode Transitioning to strict mode Template strings Deprecated features New in JavaScript New in JavaScript [Translate] ECMAScript 5 support in Mozilla [Translate] ECMAScript 6 support in Mozilla [Translate] 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] New in JavaScript 1.5 [Translate] New in JavaScript 1.6 [Translate] New in JavaScript 1.7 [Translate] New in JavaScript 1.8 [Translate] New in JavaScript 1.8.1 [Translate] New in JavaScript 1.8.5 [Translate] Documentation: Useful lists All pages index Methods index Properties index Pages tagged \"JavaScript\" Contribute JavaScript doc status The MDN project"}, {"id": "Definir_funcions", "title": "Definir\u00a0funcions"}, {"id": "Crida_de_funcions", "title": "Crida de\u00a0funcions"}, {"id": ".C3.80mbit_d'una_funci.C3.B3", "title": "\u00c0mbit d'una funci\u00f3"}, {"id": "Scope_and_the_function_stack", "title": "\u00c0mbit d'aplicaci\u00f3 i la pila de la funci\u00f3"}, {"id": "Recursion", "title": "Recursivitat"}, {"id": "Nested_functions_and_closures", "title": "Funcions aniuades i closures"}, {"id": "Efficiency_considerations", "title": "Preservaci\u00f3 de les variables"}, {"id": "Multiply-nested_functions", "title": "Funcions aniuades m\u00faltiples"}, {"id": "Name_conflicts", "title": "Conflictes de noms"}, {"id": "Closures", "title": "Closures"}, {"id": ".C3.9As_de_l'objecte_arguments", "title": "\u00das de l'objecte arguments"}, {"id": "Functions_as_event_handlers", "title": "Funcions com a controladors d'events"}, {"id": "Funcions_predefinides", "title": "Funcions predefinides"}, {"id": "Funci.C3.B3_eval", "title": "Funci\u00f3 eval"}, {"id": "Funci.C3.B3_isFinite", "title": "Funci\u00f3 isFinite"}, {"id": "Funci.C3.B3_isNaN", "title": "Funci\u00f3 isNaN"}, {"id": "Funcions_parseInt_i_parseFloat", "title": "Funcions parseInt i parseFloat"}, {"id": "Funcions_Number_i_String", "title": "Funcions Number i String"}, {"id": "Funcions_escape_i_unescape_(Obsoletes_a_partir_de_JavaScript_1.5)", "title": "Funcions escape i unescape (Obsoletes a partir de JavaScript 1.5)"}], "id": 135569, "review_tags": []}