I need to pass a variable inside an array of items, a parameter that only accepts string, but when I pass a variable the API does not accept, it says the parameter is incorrect.
Better explaining:
var userstocreate = [
{
username: 'aqui a variavel',
password: 'senha',
firstname: 'nome',
lastname: 'sobrenome',
email: 'email'
}
In the username where the 'variable is here' I have to enclose it in single quotes.
Does anyone have a light to do this?
I did it, thanks for the help everyone was like.
var userstocreate = [
{
username: '' + usuario + '',
password: 'E@d123456',
firstname: '' + primeiro +'',
lastname: '' + lastname + '',
email: '' + email + ''
}
];
var primeiro = this.firstname.toString();
var usuario = this.username.toString();
var lastname = this.lastname.toString();
var email = this.email.toString();