美文网首页全栈开发
面向对象常用方法

面向对象常用方法

作者: 月光在心中 | 来源:发表于2017-08-01 11:02 被阅读1次

非脚本语言有编译
js脚本语言 直接啃 无编译(代码)

Property属性
hasOwnProperty 在Object原型中 用于检查某属性是否是私有属性
console.log(plane.hasOwnProperty("color")) 是返回true 否则false

数组下标以私有属性存在、所以在给数组添加原型属性时要注意、不要添加,在遍历时会找到所添加的原型属性 for(var n in arr){console.log(n)} n-->属性名

in 关键字用来判断某属性是否可用 即是否是对象的私有属性或共有属性

对象遍历?
用keys和getOwnPropertyName获取键(属性名)集合
var k = Object.keys(plane);
for(var i=0 ;i<k.length; i++){console.log("键:"+ k.[i]) +" 值:" +plane[k.[i]];}

new关键字--> 面试
底层属性 隐士属性
实参 arguments 参数的集合 不是数组 但可以用数组形式使用下标
instanceof? 看是否是构造函数的实例

架构 技术(充电)

回调函数作为主函数的附属

&& || 可替代简单的if语句 afterWork && afterWork();
|| 备用处理 (备用值) var obj = param || "男";前面值无效执行后面的值,后面值作为备用值
&& 校验

健壮性-->适应的场景多

callback回调 callback && callback();

架构好 才好

keys getOwnPropertyName Object.keys(对象)获取键/属性名集合
hasOwnPropertyName hasOwnPropertyName 对象.hasOwnPropertyName("color")
callback callback afterWork afterWork afterWork arguments arguments arguments
arguments arguments arguments instanceof instanceof instanceof instanceof
instanceof arguments arguments afterWork afterWork afterWork target target
target target target arguments arguments argument arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments instanceof instanceof instanceof instanceof instanceof instanceof instanceof instanceof instanceof instanceof instanceof arguments instanceof

需要等 要用回调函数(匿名函数)

***事件代理() 减少了绑定的事件数量
事件委托大大减少页面绑定事件数量 提高了页面性能
事件委托针对节点动态变化场景 无序重新绑定

学号 姓名 年龄 增删改查

竞品分析

for in 遍历时 n 是字符串形式 for(var n in arr)
在标签上添加自定义属性
targetName 大写
attributes attributes attributes attributes attributes attributes attributes attributes attributes attributes arguments参数数组 arguments attributes 属性数组

函数 数组5个常用方法 字符串常用方法 正则 常见 \s空白

相关文章

  • 面向对象常用方法

    非脚本语言有编译js脚本语言 直接啃 无编译(代码) Property属性hasOwnProperty 在Obje...

  • Python Debug

    常用方法 try...except 方法捕获异常 Python----面向对象---try....except的详...

  • (七)面向对象的程序设计(类)

    1、面向对象的概念常用的编程方式有两种:面向过程 和 面向对象。面向过程:是早期程序员所使用的方法,首先将问题分解...

  • 回顾Date.0409(Js 基本编程方法)

    编程方法 面向过程 面向对象(常用)三个作用:封装、 继承、多态。 参考文档:https://www.jiansh...

  • 信息系统开发方法

    信息系统常用的开发方法有结构化方法,面向对象方法,原型法,面向服务方法。 其中,结构化方法,是一种传统的开发方法,...

  • 1.2 信息系统开发方法

    常用开发方法 结构化方法 面向对象方法 原型化方法 面向服务的方法 1. 结构化方法 也成生命周期法。是一种传统的...

  • 面向对象版学员管理系统

    课程:面向对象版学员管理系统 目标 了解面向对象开发过程中类内部功能的分析方法 了解常用系统功能添加删除修改查询 ...

  • python面向对象编程的常用方法及专用术语详解

    python面向对象编程的常用方法 方法名称功能描述__init__构造函数,在类生成对象之后就会被执行__del...

  • Python基础-OOP

    OOP 思想以模块化思想解决工程问题面向过程 VS 面向对象由面向过程转向面向对象 常用名词OO:面向对象OOA:...

  • 面向对象

    面向对象方法概论 对象、结构 概念呢 特征 1.1 什么是面向对象 面向对象方法的基本思想 对象 属性-静态特征 ...

网友评论

    本文标题:面向对象常用方法

    本文链接:https://www.haomeiwen.com/subject/svqjlxtx.html