From 4b1a9203c547c019fc5398082ae19a3f3d4c3efe Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:41:15 -0500 Subject: initial commit --- .../global_objects/function/arguments/index.html | 125 +++++++++++ .../global_objects/function/arity/index.html | 70 ++++++ .../global_objects/function/caller/index.html | 124 +++++++++++ .../reference/global_objects/function/index.html | 236 +++++++++++++++++++++ .../global_objects/function/length/index.html | 134 ++++++++++++ .../global_objects/function/name/index.html | 153 +++++++++++++ .../global_objects/function/tosource/index.html | 97 +++++++++ 7 files changed, 939 insertions(+) create mode 100644 files/ca/web/javascript/reference/global_objects/function/arguments/index.html create mode 100644 files/ca/web/javascript/reference/global_objects/function/arity/index.html create mode 100644 files/ca/web/javascript/reference/global_objects/function/caller/index.html create mode 100644 files/ca/web/javascript/reference/global_objects/function/index.html create mode 100644 files/ca/web/javascript/reference/global_objects/function/length/index.html create mode 100644 files/ca/web/javascript/reference/global_objects/function/name/index.html create mode 100644 files/ca/web/javascript/reference/global_objects/function/tosource/index.html (limited to 'files/ca/web/javascript/reference/global_objects/function') diff --git a/files/ca/web/javascript/reference/global_objects/function/arguments/index.html b/files/ca/web/javascript/reference/global_objects/function/arguments/index.html new file mode 100644 index 0000000000..6371caeb23 --- /dev/null +++ b/files/ca/web/javascript/reference/global_objects/function/arguments/index.html @@ -0,0 +1,125 @@ +--- +title: Function.arguments +slug: Web/JavaScript/Reference/Global_Objects/Function/arguments +translation_of: Web/JavaScript/Reference/Global_Objects/Function/arguments +--- +
{{JSRef}} {{deprecated_header}}
+ +

La propietat function.arguments es refereix a un objecte que s'assembla a una array corresponent als arguments passats a una funció. Utilitzeu la variable simple {{jsxref("Functions/arguments", "arguments")}}.

+ +

Descripció

+ +

La sintaxis function.arguments és obsoleta. El camí recomanat per accedir a l'objecte {{jsxref("Functions/arguments", "arguments")}} disponible en les funcions requereix simplement referir-se a la variable{{jsxref("Functions/arguments", "arguments")}}.

+ +

En cas de recursivitat, és a dir, si la funció f apareix vàries vegades en la pila de crides, el valor det f.arguments representa els arguments corresponents a la invocació més recent de la funció.

+ +

El valor del la propietat arguments normalment és null si no hi ha una invocació excel·lent de la funció (això vol dir, que s'ha cridat la funció però la seva execució encara no s'ha acabat).

+ +

Exemples

+ +
function f(n) { g(n - 1); }
+
+function g(n) {
+  console.log('before: ' + g.arguments[0]);
+  if (n > 0) { f(n); }
+  console.log('after: ' + g.arguments[0]);
+}
+
+f(2);
+
+console.log('returned: ' + g.arguments);
+
+// Resultat
+
+// abans: 1
+// abans: 0
+// després: 0
+// després: 1
+// retorn: null
+
+ +

Especificacions

+ + + + + + + + + + + + + + + + + + + + + + + + +
EspecificacióEstatComentaris
{{SpecName('ES1')}}{{Spec2('ES1')}}Definició inicial. Implementat en JavaScript 1.0. Obsolet a favor de {{jsxref("Functions/arguments", "arguments")}} en ES3.
{{SpecName('ES5.1', '#sec-10.6', 'arguments object')}}{{Spec2('ES5.1')}}{{jsxref("Functions/arguments", "arguments")}} object
{{SpecName('ES6', '#sec-arguments-object', 'arguments object')}}{{Spec2('ES6')}}{{jsxref("Functions/arguments", "arguments")}} object
+ +

Compatibilitat amb navegadors

+ +
{{CompatibilityTable}}
+ +
+ + + + + + + + + + + + + + + + + + + +
CaracterísticaChromeFirefox (Gecko)Internet ExplorerOperaSafari
Suport bàsic{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
CaracterístcaAndroidChrome per AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Suport bàsic{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +

Vegeu també

+ + diff --git a/files/ca/web/javascript/reference/global_objects/function/arity/index.html b/files/ca/web/javascript/reference/global_objects/function/arity/index.html new file mode 100644 index 0000000000..d330307535 --- /dev/null +++ b/files/ca/web/javascript/reference/global_objects/function/arity/index.html @@ -0,0 +1,70 @@ +--- +title: Function.arity +slug: Web/JavaScript/Reference/Global_Objects/Function/arity +translation_of: Archive/Web/JavaScript/Function.arity +--- +
{{JSRef}} {{obsolete_header}}
+ +

La propietat arity solia retornar el número d'arguments esperats per la funció, tanmateix, ja no existeix i s'ha reemplaçat per la propietat {{jsxref("Function.prototype.length")}}.

+ +

Especificacions

+ +

Implementat en JavaScript 1.2. Obsolet en JavaScript 1.4.}

+ +

Compatibilitat amb navegadors

+ +
{{CompatibilityTable}}
+ +
+ + + + + + + + + + + + + + + + + + + +
CaracterísticaChromeFirefox (Gecko)Internet ExplorerOperaSafari
Suport bàsic{{CompatNo}}{{CompatNo}}{{CompatNo}}{{CompatNo}}{{CompatNo}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
CaracterísticaAndroidChrome per AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Suport bàsic{{CompatNo}}{{CompatNo}}{{CompatNo}}{{CompatNo}}{{CompatNo}}{{CompatNo}}
+
+ +

Vegeu també

+ + diff --git a/files/ca/web/javascript/reference/global_objects/function/caller/index.html b/files/ca/web/javascript/reference/global_objects/function/caller/index.html new file mode 100644 index 0000000000..613e163d6a --- /dev/null +++ b/files/ca/web/javascript/reference/global_objects/function/caller/index.html @@ -0,0 +1,124 @@ +--- +title: Function.caller +slug: Web/JavaScript/Reference/Global_Objects/Function/caller +translation_of: Web/JavaScript/Reference/Global_Objects/Function/caller +--- +
{{JSRef}} {{non-standard_header}}
+ +

La propietat function.caller retorna la funció que ha invocat la funció especificada.

+ +

Descripció

+ +

SI la funció f ha estat invocada pel codi de nivell superior, el valor de f.caller és {{jsxref("null")}}, sinó és la funció que ha cridat f.

+ +

Aquesta propietat reemplaça la propietat obsoleta {{jsxref("Functions/arguments/caller", "arguments.caller")}} de l'objecte {{jsxref("Functions/arguments", "arguments")}}.

+ +

La propietat especial __caller__, la qual retorna l'objecte activatwhich returned the activation object of the caller thus allowing to reconstruct the stack, was removed for security reasons.

+ +

Notes

+ +

Vegeu que en cas de recursió, no podeu reconstruir la pila de crida fent servir aquesta propietat. C that in case of recursion, you can't reconstruct the call stack using this property. Tingueu en compte:

+ +
function f(n) { g(n - 1); }
+function g(n) { if (n > 0) { f(n); } else { stop(); } }
+f(2);
+
+ +

At the moment stop() is called the call stack will be:

+ +
f(2) -> g(1) -> f(1) -> g(0) -> stop()
+
+ +

El següent és cert:

+ +
stop.caller === g && f.caller === g && g.caller === f
+
+ +

so if you tried to get the stack trace in the stop() function like this:

+ +
var f = stop;
+var stack = 'Stack trace:';
+while (f) {
+  stack += '\n' + f.name;
+  f = f.caller;
+}
+
+ +

El bucle mai s'aturaria.

+ +

Exemples

+ +

Checking the value of a function's caller property

+ +

El codi següent comprova que el valor following code checks the value a function's caller property.

+ +
function myFunc() {
+  if (myFunc.caller == null) {
+    return 'The function was called from the top!';
+  } else {
+    return 'This function\'s caller was ' + myFunc.caller;
+  }
+}
+
+ +

Especificacions

+ +

No forma part de cap especificació. Implementat en JavaScript 1.5.

+ +

Compatibilitat amb navegadors

+ +
{{CompatibilityTable}}
+ +
+ + + + + + + + + + + + + + + + + + + +
CaracterísticaChromeFirefox (Gecko)Internet ExplorerOperaSafari
Suport bàsic{{CompatVersionUnknown}}{{CompatGeckoDesktop("1.0")}}8.0{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
CaracterísticaAndroidChrome per AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Suport bàsic{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatGeckoMobile("1.0")}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +

Vegeu també

+ + diff --git a/files/ca/web/javascript/reference/global_objects/function/index.html b/files/ca/web/javascript/reference/global_objects/function/index.html new file mode 100644 index 0000000000..9cb0571d13 --- /dev/null +++ b/files/ca/web/javascript/reference/global_objects/function/index.html @@ -0,0 +1,236 @@ +--- +title: Function +slug: Web/JavaScript/Reference/Global_Objects/Function +tags: + - Constructor + - Function + - JavaScript + - NeedsTranslation + - TopicStub +translation_of: Web/JavaScript/Reference/Global_Objects/Function +--- +
{{JSRef}}
+ +

The Function constructor creates a new Function object. In JavaScript every function is actually a Function object.

+ +

Syntax

+ +
new Function ([arg1[, arg2[, ...argN]],] functionBody)
+ +

Parameters

+ +
+
arg1, arg2, ... argN
+
Names to be used by the function as formal argument names. Each must be a string that corresponds to a valid JavaScript identifier or a list of such strings separated with a comma; for example "x", "theValue", or "a,b".
+
functionBody
+
A string containing the JavaScript statements comprising the function definition.
+
+ +

Description

+ +

Function objects created with the Function constructor are parsed when the function is created. This is less efficient than declaring a function with a function expression or function statement and calling it within your code, because such functions are parsed with the rest of the code.

+ +

All arguments passed to the function are treated as the names of the identifiers of the parameters in the function to be created, in the order in which they are passed.

+ +
+

Note: Functions created with the Function constructor do not create closures to their creation contexts; they always are created in the global scope. When running them, they will only be able to access their own local variables and global ones, not the ones from the scope in which the Function constructor was called. This is different from using {{jsxref("eval")}} with code for a function expression.

+
+ +

Invoking the Function constructor as a function (without using the new operator) has the same effect as invoking it as a constructor.

+ +

Properties and Methods of Function

+ +

The global Function object has no methods or properties of its own, however, since it is a function itself it does inherit some methods and properties through the prototype chain from {{jsxref("Function.prototype")}}.

+ +

Function prototype object

+ +

Properties

+ +
{{page('/en-US/docs/JavaScript/Reference/Global_Objects/Function/prototype', 'Properties')}}
+ +

Methods

+ +
{{page('/en-US/docs/JavaScript/Reference/Global_Objects/Function/prototype', 'Methods')}}
+ +

Function instances

+ +

Function instances inherit methods and properties from {{jsxref("Function.prototype")}}. As with all constructors, you can change the constructor's prototype object to make changes to all Function instances.

+ +

Examples

+ +

Specifying arguments with the Function constructor

+ +

The following code creates a Function object that takes two arguments.

+ +
// Example can be run directly in your JavaScript console
+
+// Create a function that takes two arguments and returns the sum of those arguments
+var adder = new Function('a', 'b', 'return a + b');
+
+// Call the function
+adder(2, 6);
+// > 8
+
+ +

The arguments "a" and "b" are formal argument names that are used in the function body, "return a + b".

+ +

A recursive shortcut to massively modify the DOM

+ +

Creating functions with the Function constructor is one of the ways to dynamically create an indeterminate number of new objects with some executable code into the global scope from a function. The following example (a recursive shortcut to massively modify the DOM) is impossible without the invocation of the Function constructor for each new query if you want to avoid closures.

+ +
<!doctype html>
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<title>MDN Example - a recursive shortcut to massively modify the DOM</title>
+<script type="text/javascript">
+var domQuery = (function() {
+  var aDOMFunc = [
+    Element.prototype.removeAttribute,
+    Element.prototype.setAttribute,
+    CSSStyleDeclaration.prototype.removeProperty,
+    CSSStyleDeclaration.prototype.setProperty
+  ];
+
+  function setSomething(bStyle, sProp, sVal) {
+    var bSet = Boolean(sVal), fAction = aDOMFunc[bSet | bStyle << 1],
+        aArgs = Array.prototype.slice.call(arguments, 1, bSet ? 3 : 2),
+        aNodeList = bStyle ? this.cssNodes : this.nodes;
+
+    if (bSet && bStyle) { aArgs.push(''); }
+    for (
+      var nItem = 0, nLen = this.nodes.length;
+      nItem < nLen;
+      fAction.apply(aNodeList[nItem++], aArgs)
+    );
+    this.follow = setSomething.caller;
+    return this;
+  }
+
+  function setStyles(sProp, sVal) { return setSomething.call(this, true, sProp, sVal); }
+  function setAttribs(sProp, sVal) { return setSomething.call(this, false, sProp, sVal); }
+  function getSelectors() { return this.selectors; };
+  function getNodes() { return this.nodes; };
+
+  return (function(sSelectors) {
+    var oQuery = new Function('return arguments.callee.follow.apply(arguments.callee, arguments);');
+    oQuery.selectors = sSelectors;
+    oQuery.nodes = document.querySelectorAll(sSelectors);
+    oQuery.cssNodes = Array.prototype.map.call(oQuery.nodes, function(oInlineCSS) { return oInlineCSS.style; });
+    oQuery.attributes = setAttribs;
+    oQuery.inlineStyle = setStyles;
+    oQuery.follow = getNodes;
+    oQuery.toString = getSelectors;
+    oQuery.valueOf = getNodes;
+    return oQuery;
+  });
+})();
+</script>
+</head>
+
+<body>
+
+<div class="testClass">Lorem ipsum</div>
+<p>Some text</p>
+<div class="testClass">dolor sit amet</div>
+
+<script type="text/javascript">
+domQuery('.testClass')
+  .attributes('lang', 'en')('title', 'Risus abundat in ore stultorum')
+  .inlineStyle('background-color', 'black')('color', 'white')('width', '100px')('height', '50px');
+</script>
+</body>
+
+</html>
+
+ +

Specifications

+ + + + + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('ES1')}}{{Spec2('ES1')}}Initial definition. Implemented in JavaScript 1.0.
{{SpecName('ES5.1', '#sec-15.3', 'Function')}}{{Spec2('ES5.1')}} 
{{SpecName('ES6', '#sec-function-objects', 'Function')}}{{Spec2('ES6')}} 
+ +

Browser compatibility

+ +
{{CompatibilityTable}}
+ +
+ + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +

See also

+ + diff --git a/files/ca/web/javascript/reference/global_objects/function/length/index.html b/files/ca/web/javascript/reference/global_objects/function/length/index.html new file mode 100644 index 0000000000..2af00ebf41 --- /dev/null +++ b/files/ca/web/javascript/reference/global_objects/function/length/index.html @@ -0,0 +1,134 @@ +--- +title: Function.length +slug: Web/JavaScript/Reference/Global_Objects/Function/length +translation_of: Web/JavaScript/Reference/Global_Objects/Function/length +--- +
{{JSRef}}
+ +

La propietat length especifica el nombre d'arguments que la funció espera.

+ +
{{js_property_attributes(0,0,1)}}
+ +

Descripció

+ +

length és una propietat d'un objecte funció, i indica quants arguments la funció espera,  és a dir, el nombre de paràmetres formals. Aquest nombre no inclou el  {{jsxref("rest_parameters", "rest parameter", "", 1)}}. Per contra, {{jsxref("Functions_and_function_scope/arguments/length", "arguments.length")}} és local a la funció i retorna el nombre d'arguments que s'han passat a la funció.

+ +

Propietat Data del constructor Function

+ +

El constructor {{jsxref("Function")}} és per ell mateix un objecte {{jsxref("Function")}}. La seva propietat data length pren un valor d'1. Els atributs de la propietat són: Writable: false, Enumerable: false, Configurable: true.

+ +

Propietat de l'objecte prototipus Function

+ +

La propietat length de l'objecte prototipus {{jsxref("Function")}} pren un valor de 0.

+ +

Exemples

+ +
console.log(Function.length); /* 1 */
+
+console.log((function()        {}).length); /* 0 */
+console.log((function(a)       {}).length); /* 1 */
+console.log((function(a, b)    {}).length); /* 2 etc. */
+console.log((function(...args) {}).length); /* 0, la resta de paràmetres no es conta */
+
+ +

Especificacions

+ + + + + + + + + + + + + + + + + + + + + + + + +
EspecificacióEstatComentaris
{{SpecName('ES1')}}{{Spec2('ES1')}}Definció inicial. Implementat en JavaScript 1.1.
{{SpecName('ES5.1', '#sec-15.3.5.1', 'Function.length')}}{{Spec2('ES5.1')}} 
{{SpecName('ES6', '#sec-function-instances-length', 'Function.length')}}{{Spec2('ES6')}}L'atribut configurable d'aquesta propietat és ara  true.
+ +

Compatibilitat amb navegadors

+ +
{{CompatibilityTable}}
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
CaracterísticaChromeFirefox (Gecko)Internet ExplorerOperaSafari
Suport bàsic{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
Configurable: true{{CompatUnknown}}{{CompatGeckoDesktop(37)}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CaracterísticaAndroidChrome per AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Suport bàsic{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
Configurable: true{{CompatUnknown}}{{CompatUnknown}}{{CompatGeckoMobile(37)}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
+
+ +

Vegeu també

+ + diff --git a/files/ca/web/javascript/reference/global_objects/function/name/index.html b/files/ca/web/javascript/reference/global_objects/function/name/index.html new file mode 100644 index 0000000000..6f88ba9be2 --- /dev/null +++ b/files/ca/web/javascript/reference/global_objects/function/name/index.html @@ -0,0 +1,153 @@ +--- +title: Function.name +slug: Web/JavaScript/Reference/Global_Objects/Function/name +translation_of: Web/JavaScript/Reference/Global_Objects/Function/name +--- +
{{JSRef}}
+ +

La propietat function.name retorna el nom de la funció.

+ +
{{js_property_attributes(0,0,1)}}
+ +
Vegeu que en les implementacions no estàndards anteriors a ES2015 l'atribut configurable també era false.
+ +

Descripció

+ +

La propietat name retorna el nom de la funció, o una cadena buida per les funcions anònimes.

+ +
function fesAlgo() {}
+
+console.log(desAlgo.name); // escriu "fesAlgo"
+
+ +

Les funcions creades amb la sintaxis new Function(...) o sols Function(...)tenen la seva propietat name en una cadena buida. En els exemples següents es creen funcions anònimes , de forma que name retorna una cadena buida:

+ +
var f = function() {};
+var object = {
+  someMethod: function() {}
+};
+
+console.log(f.name == ''); // true
+console.log(object.someMethod.name == ''); // també true
+
+ +

Es pot definir una funció amb un nom en un {{jsxref("Operators/Function", "function expression", "", 1)}}:

+ +
var object = {
+  someMethod: function object_someMethod() {}
+};
+console.log(object.someMethod.name); // logs "object_someMethod"
+
+try { object_someMethod } catch(e) { console.log(e); }
+// ReferenceError: object_someMethod no està definit
+
+ +

No es pot canviar el nom de la funció, aquesta propietat és només llegible:

+ +
var object = {
+  // anònima
+  someMethod: function() {}
+};
+
+object.someMethod.name = 'someMethod';
+console.log(object.someMethod.name); // cadena buida, someMethod és anònima.
+
+ +

Per canviar-ho, es pot utilitzar {{jsxref("Object.defineProperty()")}}.

+ +

Exemples

+ +

Es pot utilitzar obj.constructor.name per comprovar la "classe" d'un objecte:

+ +
function a() {}
+
+var b = new a();
+
+console.log(b.constructor.name); // escriu "a"
+
+ +

Especificacions

+ + + + + + + + + + + + + + +
EspecificacióEstatComentaris
{{SpecName('ES2015', '#sec-name', 'name')}}{{Spec2('ES2015')}}Definició inicial.
+ +

Comptabilitat amb navegadors

+ +
{{CompatibilityTable}}
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
CaracterísticaChromeFirefox (Gecko)Internet ExplorerOperaSafari
Suport bàsic33{{CompatVersionUnknown}}{{CompatNo}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
Configurable: true43{{CompatGeckoDesktop(38)}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CaracterísticaAndroidChrome per AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Suport bàsic{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatNo}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
Configurable: true{{CompatUnknown}}{{CompatUnknown}}{{CompatGeckoMobile(38)}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
+
diff --git a/files/ca/web/javascript/reference/global_objects/function/tosource/index.html b/files/ca/web/javascript/reference/global_objects/function/tosource/index.html new file mode 100644 index 0000000000..27f135ce13 --- /dev/null +++ b/files/ca/web/javascript/reference/global_objects/function/tosource/index.html @@ -0,0 +1,97 @@ +--- +title: Function.prototype.toSource() +slug: Web/JavaScript/Reference/Global_Objects/Function/toSource +translation_of: Web/JavaScript/Reference/Global_Objects/Function/toSource +--- +
{{JSRef}} {{non-standard_header}}
+ +

El mètode toSource()retorna una cadena que representa el codi font de l'objecte.

+ +

Sintaxi

+ +
function.toSource();
+Function.toSource();
+
+ +

Paràmetres

+ +

Cap.

+ +

Descripció

+ +

El mètode toSource retorna els valors següents:

+ + + +

Aquest mètode se sol cridar internament per JavaScript i no explícitament en el codi. Podeu cridar toSource durant la depuració per examinar el contingut d'un objecte.

+ +

Especificacions

+ +

No forma part de cap estàndard. Implementat en JavaScript 1.3.

+ +

Compatibilitat amb navegadors

+ +
{{CompatibilityTable}}
+ +
+ + + + + + + + + + + + + + + + + + + +
CaracterísticaChromeFirefox (Gecko)Internet ExplorerOperaSafari
Suport bàsic{{CompatNo}}{{CompatVersionUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
CaracterísticaAndroidChrome per AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Suport bàsic{{CompatUnknown}}{{CompatUnknown}}{{CompatVersionUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
+
+ +

Vegeu també

+ + -- cgit v1.2.3-54-g00ecf