![](https://img-blog.csdnimg.cn/20190927151043371.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
JavaScript
诗意孤舟
这个作者很懒,什么都没留下…
展开
-
js练习题:搜索框内容
##js练习题:搜索框内容<!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">原创 2022-04-07 21:49:29 · 65 阅读 · 0 评论 -
函数简易计算器
函数简易计算器 function getSum(num1,num2){ switch(page){ case '1': return num1 + num2; break; case '2':原创 2022-03-12 16:13:01 · 399 阅读 · 0 评论 -
写一个函数实现对数字数组的排序
写一个函数实现对数字数组的排序 function getSum(arr){ // 外层for循环控制行数 for(var i = 0; i <=arr.length - 1; i++){ // 内层for循环控制次数 for(j = 0; j <= arr.原创 2022-03-12 15:33:37 · 1021 阅读 · 0 评论 -
js练习题:构建函数创建一个车对象
js练习题:构建函数创建一个车对象该对象有重量,颜色,牌子,可以载人,拉货,耕田。function Car (weight,color,brand){ this.weight = weight; this.color = color; this.brand = brand; this原创 2022-03-12 12:27:52 · 1991 阅读 · 0 评论 -
js练习题:构建函数创建一个电脑对象
js练习题:构建函数创建一个电脑对象该对象有颜色,重量,品牌,型号,可以看电影,听音乐,打游戏和敲代码。 function Computer(color,weight,brand,model){ this.color = color; this.weight = weight; this.brand = brand;原创 2022-03-12 11:37:22 · 4304 阅读 · 0 评论 -
js练习题:构建函数创建两个对象
js练习题:构建函数创建两个对象公共部分:姓名属性,类型属性,血量属性和攻击方式。英雄对象:廉颇,后裔。英雄对象信息:廉颇 力量型 500血量 近战。 后裔 射手型 100血量 远程。 function Hero(name,type,blood){ this.name = name; this.type = type; this.bl原创 2022-03-11 23:49:53 · 869 阅读 · 0 评论 -
js练习题:对象字面量的形式创建一个名字为可可的狗对象
js练习题:对象字面量的形式创建一个名字为可可的狗对象名称:可可类型:阿拉斯加犬年龄:5岁颜色:棕红色技能:汪汪汪(Call),演电影(ShowFilm)<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name=原创 2022-03-09 23:44:14 · 5279 阅读 · 1 评论