
jQuery练习t310,从0到1
发布日期:2021-05-06 21:15:12
浏览次数:18
分类:原创文章
本文共 1151 字,大约阅读时间需要 3 分钟。
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Title</title> <script src="../js/jquery-3.5.1.js"></script> <script> //检测操作 //$.isPlainObject() 检测变量是否为原始对象 $(function () { var person = { name : "tom", age: 5, hobby : "running" }; document.writeln($.isPlainObject(person)); // true document.writeln("<br>"); function Box(width, height) { this.width = width; this.height = height; } var box = new Box(100,100); document.writeln($.isPlainObject(box)); // false document.writeln("<br>"); document.writeln($.isFunction(Box)); //true class Fox { constructor(width,height) { this._width = width; this._height = height; } } var fox1 = new Fox(100,100); document.writeln("<br>"); document.writeln($.isPlainObject(fox1)); //false }); </script></head><body></body></html>