简体   繁体   中英

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.

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?

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. 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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