25 String 对象中的属性
2021/12/23 23:11:18
本文主要是介绍25 String 对象中的属性,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Document</title> <!-- String 对象中的属性 --> </head> <body> <script> var str = new String("JavaScript"); String.prototype.name = null; str.name = "Hello World!"; document.write(str.constructor + "</br>"); // 输出:function String(){[native code]} document.write(str.length + "</br>"); // 输出:10 document.write(str.name); // 输出:Hello World! </script> </body> </html>这篇关于25 String 对象中的属性的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-10-19TypeScript进阶:从入门到实践
- 2024-10-19Drizzle ORM教程:轻松入门与实践指南
- 2024-10-19Drizzle ORM教程:从入门到简单应用
- 2024-10-19OAuth接入教程:新手入门指南
- 2024-10-19公共API教程:新手入门指南
- 2024-10-19Server Action教程:一步步入门指南
- 2024-10-19Server Component教程:新手入门指南
- 2024-10-19TRPC教程:新手入门与基础使用指南
- 2024-10-19Uppy教程:快速入门与实践指南
- 2024-10-19uppy教程:轻松入门指南