简体   繁体   English

解密 JavaScript 代码并修改 Chrome 控制台?

[英]Decrypt JavaScript code and modify Chrome console?

I'm not a JavaScript expert, and I wanted to ask you if you could explain this code to me.我不是 JavaScript 专家,我想问你是否可以向我解释这段代码。

More than anything else, I would like to know which values ​​are written in capital letters and what the two points mean:最重要的是,我想知道哪些值是大写的,两点是什么意思:

popup: [function(e, t) {
    "use strict";
    amo.timer = {
        CONTO: 10,
        STELLA_PARIS: 4,
        COVER_DATA: 140,
        STAMP_MODE: 20,
        LOOP: {
            ALT_1: 60,
            ALT_2: 14
        },
        COMBINANCE: {
            mode_1: 40,
            mode_2: 12,
            mode_3: 15,
            mode_4: 15,
            mode_5: 13,
            mode_6: 11,
            restpost: 0.5,
            status_log: 0.5
        },
        REGISTER_AMP: {
            mode_1: 20,
            mode_2: 11,
            mode_3: 0.5,
            mode_4: 30,
            mode_5: 0.12,
            mode_6: 1.22,
            timer_post: 12
        },

    }
}, {}],

Also, if I run this code in Chrome, how I can change the value for example of mode_1 with the console?另外,如果我在 Chrome 中运行此代码,如何使用控制台更改mode_1的值?

It's hard to tell what this snippet does without context.如果没有上下文,很难说这个片段做了什么。 It looks like a popup that take in an object and does something it.它看起来像一个弹出窗口,它接收一个对象并执行某些操作。

The capital letters (keys) and : (colon) are a way of defining a javascript object.大写字母(键)和:冒号)是定义 javascript 对象的一种方式。 Keys don't have to be in all capital letters, but in this case they are.键不必全部为大写字母,但在本例中是。 You can alter the values of an object by specifying its key.您可以通过指定其键来更改对象的值。 For example:例如:

var obj = { KEY: 'value' }
console.log(obj);
obj['KEY'] = "another value";
console.log(obj);

You can read more about javascript objects and their basics here: https://www.w3schools.com/js/js_objects.asp您可以在此处阅读有关 javascript 对象及其基础知识的更多信息: https : //www.w3schools.com/js/js_objects.asp

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM