Blogger Information
Blog 19
fans 0
comment 0
visits 5712
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
数组与对象的声明与访问
vbokok
Original
281 people have browsed it
  1. //1.数组
  2. const arr = [2, 'uname', true]
  3. console.log(arr)
  4. console.table(arr)
  5. console.log(arr[0], arr[1], arr[2])
  6. console.log(typeof arr)
  7. console.log(Array.isArray(arr))
  8. //2.对象
  9. const user = {
  10. id: 2,
  11. uname: '灭绝老师',
  12. IsMarried: true,
  13. emaill: 'admin@qq.com',
  14. }
  15. console.log(user.id, user.uname, user.IsMarried, user.emaill)
  16. user1 = {
  17. id: 2,
  18. uname: '灭绝老师',
  19. show: function () {
  20. return `id=${this.id},uname=${this.uname}`
  21. },
  22. }
  23. console.log(user1.show())

Correcting teacher:PHPzPHPz

Correction status:qualified

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post