criar objeto javascript
var pessoa = {
nome: ['Bob', 'Smith'],
idade: 32,
sexo: 'masculino',
interesses: ['música', 'esquiar'],
bio: function() {
alert(this.nome[0] + ' ' + this.nome[1] + ' tem ' + this.idade + ' anos de idade. Ele gosta de ' + this.interesses[0] + ' e ' + this.interesses[1] + '.');
},
saudacao: function() {
alert('Oi! Eu sou ' + this.nome[0] + '.');
}
};
Also in JavaScript:
- switch alert
- javascript dynamic arrays
- javascript online compiler
- js get alphabet as array
- foreach object javascript
- moment js
- using aria attributes in angular
- javascript remove last charter stings
- how to get mouse coordinates in javascript
- javascript uppercase first character of each word
- babylon js camera position
- javascript show 2 decimal places
- how to comment out code in react js
- change linear bagckgorund by javascript
- node js catch any errors
- check when input number value goes up or down
- jquery validate conditional
- jquery autocomplete database
- javascript hashtable contains key
- jquery prevent form submit
- javascript get file extension from string
- jquery select element inside element
- jquery add element array
- behaviorsubject in angular 10