function storeVarInfo(name, type, key) {
    let typeArray = [];
    if (key == undefined) {
      let keys = Object.keys(task.varNames);
      for (let i = 0; i < keys.length; i++) {
        if (task.varNames[keys[i]] == name) {
          key = keys[i][0];
        }
      }
    }
    if (type != undefined && type.length > 1) {
      let tmpArr = type.split("");
      for (let i = 0; i < tmpArr.length; i++) {
        typeArray.push(dataTypes[tmpArr[i]]);
      }
    } else if (type != undefined && type.length == 1) {
      typeArray = dataTypes[type];
    } else {
      typeArray = "random";
    }
    return {
      key,
      name,
      type: typeArray
    };
  }
/**
   * Storing variable info inside an global object 
   *
   */
Storing variable info inside an global object
Storing variable info inside an global object
function storeVarInfo(name, type, key) {
    let typeArray = [];
    if (key == undefined) {
      let keys = Object.keys(task.varNames);
      for (let i = 0; i < keys.length; i++) {
        if (task.varNames[keys[i]] == name) {
          key = keys[i][0];
        }
      }
    }
    if (type != undefined && type.length > 1) {
      let tmpArr = type.split("");
      for (let i = 0; i < tmpArr.length; i++) {
        typeArray.push(dataTypes[tmpArr[i]]);
      }
    } else if (type != undefined && type.length == 1) {
      typeArray = dataTypes[type];
    } else {
      typeArray = "random";
    }
    return {
      key,
      name,
      type: typeArray
    };
  }
function storeVarInfo ( name , type , key ) { let typeArray = [ ] ; if ( key == undefined ) { let keys = Object . keys ( task . varNames ) ; for ( let i = 0 ; i < keys . length ; i ++ ) { if ( task . varNames [ keys [ i ] ] == name ) { key = keys [ i ] [ 0 ] ; } } } if ( type != undefined && type . length > 1 ) { let tmpArr = type . split ( "" ) ; for ( let i = 0 ; i < tmpArr . length ; i ++ ) { typeArray . push ( dataTypes [ tmpArr [ i ] ] ) ; } } else if ( type != undefined && type . length == 1 ) { typeArray = dataTypes [ type ] ; } else { typeArray = "random" ; } return { key , name , type : typeArray } ; }
Storing variable info inside an global object
Storing variable info inside an global object