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>

 

上一篇:jQuery练习t311,从0到1
下一篇:jQuery练习t309,从0到1

发表评论

最新留言

路过,博主的博客真漂亮。。
[***.116.15.85]2025年04月01日 18时03分01秒