小编Jac*_*ris的帖子

有没有办法运行旧版本的 JavaScript?

我想知道是否有任何方法可以让我在网络浏览器中运行旧版本的 javascript!我有需要 ECMAScript 3 的应用程序坏了,我想知道是否有办法在没有 polyfill 库的情况下运行旧版本!

javascript

3
推荐指数
1
解决办法
1257
查看次数

如何循环一个对象并从中删除所有函数

让我们解决这个问题,我需要从对象中删除所有函数以通过 socket.io JSON 发送!假设我有一个对象,例如...

let myObject = {
    test1: "abc",
    test2: function() {
        console.log("This is a function");
    },
    test3: {
        test4: "another string",
        test5: function() {
            console.log("another function");
        },
        test6: 123
    }
}
Run Code Online (Sandbox Code Playgroud)

我也需要转换它

let myObject = {
    test1: "abc",
    test3: {
        test4: "another string",
        test6: 123
    }
}
Run Code Online (Sandbox Code Playgroud)

我试过很多鳕鱼的方法,都失败了!我会发布它们,但这会浪费您的宝贵时间。我喜欢任何可以以简洁的功能方式解决此问题的人。您诚挚的,雅各布·莫里斯

PS 这是一个 c**p 尝试这样做

let myObject = {
    test1: "abc",
    test2: function() {
        console.log("This is a function");
    },
    test3: {
        test4: "another string",
        test5: function() {
            console.log("another function");
        },
        test6: …
Run Code Online (Sandbox Code Playgroud)

javascript function

2
推荐指数
1
解决办法
1076
查看次数

标签 统计

javascript ×2

function ×1