Multidimensional associative arrays in Bash

You can’t do what you’re trying to do: bash arrays are one-dimensional $ declare -A PERSONS $ declare -A PERSON $ PERSON[“FNAME”]=’John’ $ PERSON[“LNAME”]=’Andrew’ $ declare -p PERSON declare -A PERSON='([FNAME]=”John” [LNAME]=”Andrew” )’ $ PERSONS[1]=([FNAME]=”John” [LNAME]=”Andrew” ) bash: PERSONS[1]: cannot assign list to array member You can fake multidimensionality by composing a suitable array index … Read more

Using constants as indices for JavaScript associative arrays

In ECMAScript 6 you can use computed values for object keys: var CONSTANT_A = 0, CONSTANT_B = 1 var state_machine = { [CONSTANT_A]: function () { return ‘a’ }, [CONSTANT_B]: function () { return ‘b’ } }; console.log(state_machine) This does not work in Internet Explorer 11 nor in Safari browsers: https://kangax.github.io/compat-table/es6/#test-object_literal_extensions_computed_properties

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)