Tin mới
JavaScript: Scripting language
Web APIs: Programming interfaces
Structuring content with HTML module
Dynamic scripting with JavaScript module
The "foo" variable isn't defined anywhere. It needs to be some string, so that the String.prototype.substring() method will work.
Declaring variables in the JavaScript Guide
Function scope in the JavaScript Guide
This page was last modified on Jul 8, 2025 by MDN contributors.