How to name variables dynamically

clipboard.png

now you want to dynamically name the variable BMResulteArr_ variable
what to do?

Mar.23,2021

upstairs two big gods solve, generally rarely you operate like that, of course, if you want, you can achieve through the eval method, this method supports a parameter, pass in a string, will run the string, such as eval ('var param = "123";'); alert (param); so it will directly run the parameter string, parsed as a variable assignment.
however, it is recommended to encapsulate it in an object, so that it is relatively convenient to call, easy to set up, easy to manage, and so on.


encapsulate variables in objects


JS <br>`var ps_act_num = $('.ps_act').length;

    form_data.append('ps_act_num', ps_act_num);
    for(var i=1;i<=ps_act_num;iPP){
        var act_content = 'act_content'+i;
        var act_content_id = '-sharptextPsP5a_'+i;
        var act_content_val = $(act_content_id).val();
        if(act_content_val !== ''){
            form_data.append(act_content, act_content_val);
        }
        var act_get = 'act_get'+i;
        var act_get_id = '-sharptextPsP5b_'+i;
        var act_get_val = $(act_get_id).val();
        if(act_get_val !== ''){
            form_data.append(act_get, act_get_val);
        }
    }`
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b34866-2ac65.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b34866-2ac65.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?