| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Errors/Not_a_function | [Back] [Original] |
Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
TypeError: "x" is not a function
, . , , .
, ? , , , ? , JavaScript map , JavaScript Array - .
, -. - , :
, , :
var x = document.getElementByID("foo");
// TypeError: document.getElementByID is not a function
- getElementById:
var x = document.getElementById("foo");
-, . Array.prototype.map(), Array .
var obj = { a: 13, b: 37, c: 42 };
obj.map(function (num) {
return num * 2;
});
// TypeError: obj.map is not a function
:
var numbers = [1, 4, 9];
numbers.map(function (num) {
return num * 2;
});
// Array [ 2, 8, 18 ]
This page was last modified on 24 . 2025 . by MDN contributors.
Your blueprint for a better internet.
Portions of this content are 19982026 by individual mozilla.org contributors. Content available under a Creative Commons license.
| Web Proxy Viewer | New URL | Original Page |