Multidimensional associative array in JS. How to go to the desired key?

Hello!
There is such a code.
var testObject = {
 formId : 'b-form',
 rules : {
 'login' : {
 required : true,
 minLength : 4,
 messages : {
 required : 'Login is not required'
 length : 'Login must be more 4 symbols'
}
},
 'password' : {
 minLength : 8,
 required : true,
 matched : 'repeat-password',
 messages : {
 required : 'Password is not required'
 length : 'Password must be more 8 symbols',
 match : 'Passwords is not match'
}
}
}
};

How to clean js need to teach me the value( without nested loops )?
For example how do I get the key value matched the 15 line?

Thanks in advance.
June 5th 19 at 21:33
1 answer
June 5th 19 at 21:35
Solution
For example how do I get the key value matched the 15 line?

But as the code to understand what key you want to get matched? Or do you need this
var mached = testObject.rules.password.matched;
I'm sorry, did not realize right away myself. - viva_Veum commented on June 5th 19 at 21:38

Find more questions by tags JavaScript