当前位置: 首页 > wzjs >正文

做网站赚谁的钱商丘seo排名

做网站赚谁的钱,商丘seo排名,单页网站怎么制作教程,弹幕网站开发代码1. String(字符串) String 对象用于处理和操作文本数据。 length:返回字符串的长度。 const str "Hello"; console.log(str.length); // 输出: 5 charAt(index):返回指定索引位置的字符。 const str "Hello…

1. String(字符串)

String 对象用于处理和操作文本数据。

  • length:返回字符串的长度。
const str = "Hello";
console.log(str.length); // 输出: 5
  • charAt(index):返回指定索引位置的字符。
const str = "Hello";
console.log(str.charAt(1)); // 输出: e
  • concat(str1, str2, ...):连接多个字符串。
const str1 = "Hello";
const str2 = " World";
console.log(str1.concat(str2)); // 输出: Hello World
  • toUpperCase() 和 toLowerCase():将字符串转换为大写或小写。
const str = "Hello";
console.log(str.toUpperCase()); // 输出: HELLO
console.log(str.toLowerCase()); // 输出: hello
  • indexOf(substring):返回子字符串在字符串中首次出现的位置,如果未找到则返回 -1。
const str = "Hello";
console.log(str.indexOf("l")); // 输出: 2

2. Array(数组)

Array 对象用于存储多个值,这些值可以是不同的数据类型。

  • push(item1, item2, ...):在数组末尾添加一个或多个元素,并返回新的长度。
const arr = [1, 2, 3];
const newLength = arr.push(4);
console.log(arr); // 输出: [1, 2, 3, 4]
console.log(newLength); // 输出: 4
  • pop():移除并返回数组的最后一个元素。
const arr = [1, 2, 3];
const lastElement = arr.pop();
console.log(arr); // 输出: [1, 2]
console.log(lastElement); // 输出: 3
  • splice(start, deleteCount, item1, item2, ...):从数组中添加或删除元素。
const arr = [1, 2, 3, 4];
arr.splice(1, 2, 5, 6);
console.log(arr); // 输出: [1, 5, 6, 4]
  • join(separator):将数组元素连接成一个字符串。
const arr = [1, 2, 3];
console.log(arr.join("-")); // 输出: 1-2-3
  • map(callback):创建一个新数组,其结果是该数组中的每个元素都调用一个提供的函数后返回的结果。
const arr = [1, 2, 3];
const newArr = arr.map(item => item * 2);
console.log(newArr); // 输出: [2, 4, 6]

3. Date(日期)

Date 对象用于处理日期和时间。

  • 创建日期对象
const now = new Date(); // 当前日期和时间
const specificDate = new Date("2025-04-21"); // 指定日期
  • getFullYear():返回年份。
const date = new Date();
console.log(date.getFullYear()); // 输出当前年份
  • getMonth():返回月份(0 - 11,0 表示一月)。
const date = new Date();
console.log(date.getMonth()); // 输出当前月份
  • getDate():返回日期(1 - 31)。
const date = new Date();
console.log(date.getDate()); // 输出当前日期
  • toLocaleString():将日期转换为本地字符串表示。
const date = new Date();
console.log(date.toLocaleString()); // 输出本地日期和时间字符串

4. Math(数学)

Math 是一个内置对象,它拥有一些数学常数和函数。

  • Math.PI:圆周率。
console.log(Math.PI); // 输出: 3.141592653589793
  • Math.random():返回一个介于 0(包含)和 1(不包含)之间的随机数。
console.log(Math.random()); // 输出一个随机数
  • Math.floor(x):返回小于或等于 x 的最大整数。
console.log(Math.floor(3.9)); // 输出: 3
  • Math.ceil(x):返回大于或等于 x 的最小整数。
console.log(Math.ceil(3.1)); // 输出: 4
  • Math.max(x1, x2, ...) 和 Math.min(x1, x2, ...):返回一组数中的最大值和最小值。
console.log(Math.max(1, 2, 3)); // 输出: 3
console.log(Math.min(1, 2, 3)); // 输出: 1

http://www.dtcms.com/wzjs/380543.html

相关文章:

  • 软件下载网站模板关键词优化排名软件哪家好
  • 中国建设银行网站怎么改支付密码忘了怎么办杭州搜索引擎推广排名技术
  • 哪个医学网站大夫可以做离线题b站大全永不收费2023入口在哪
  • 黑群晖的做网站文件营销网站建设免费
  • axure怎么做响应式网站兰州网络seo公司
  • 长春网站建设工作室企业网络营销策略分析
  • 上市公司中 哪家网站做的好国内b2b十大平台排名
  • 现在还用dw做网站设计么郴州网站建设
  • 怎么做好网站客服seo优化有百度系和什么
  • 哪里有做营销型网站的公司快手刷粉网站推广
  • 安阳网警巡查执法郑州网站seo
  • 广州定制网站建设百度知道下载
  • 网站已经克隆好了 怎么做仿站网络营销方式有哪些?
  • 医疗网站建设精英关于进一步优化 广州
  • 怎样建网站赚钱百度推荐现在为什么不能用了
  • 合肥建设委员会网站首页b2b平台是什么意思
  • 网站制作的要求湖北网站推广
  • 网站开发实例 csdn营销型网站有哪些
  • wordpress带登陆主题酒店seo是什么意思
  • 织梦网站首页栏目修改互联网营销师培训费用是多少
  • 网络设计工资多少无锡seo网络推广
  • 贵阳专业网站建设公司百度地图在线查询
  • 网站建设有几块软文范例大全800字
  • 铁岭网站建设网络优化搜索引擎查重
  • 网页编辑软件都有哪些青岛招聘seo
  • 网站建设功能报价表百度我的订单app
  • 上海交通大学毕业设计网站网络营销的内容有哪些方面
  • 做网站的内容个人建网站步骤
  • 客服网站怎么做八百客crm系统登录入口
  • 武汉 做网站专业网络推广公司排名