Montrer les trois premiers résultats d'un objet
Bonjour,
J'ai un objet comme suite, et je voulais montrer que les 3 premiers résultats:
Citation:
Au moins <span style="color: orange; font-weight: bold;">' +userMinChars+ ' </span>charactères
Maximum <span style="color: orange; font-weight: bold;">' +userMaxChars+ ' </span>charactères
Caractères supportés: <span style="color: orange; font-weight: bold;">'+userRegexChars+' </span>
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
var filterErrors = [];
filterErrors['fr'] = {
'username': {
'lessChars': 'Au moins <span style="color: orange; font-weight: bold;">' +userMinChars+ ' </span>charactères',
'moreChars': 'Maximum <span style="color: orange; font-weight: bold;">' +userMaxChars+ ' </span>charactères',
'regex': 'Caractères supportés: <span style="color: orange; font-weight: bold;">'+userRegexChars+' </span>',
'success': 'Le nom est accepté'
},
'password': {
'lessChars': 'Password au moins '+ passMinChars +' charactères',
'moreChars': 'Password au max '+ passMaxChars +' charactères',
'regex': 'Caractères supportés: '+passRegexChars,
'success': 'Password est accepté'
}
}; |
J'ai essayé avec slice, mais elle retourne undefined function
Merci a vous