What does const {username, password} = this mean in JS?

  • 0
    I met this construction:

    ...
    methods: {
     login: function () {
       const { username, password } = this
       myLoginRoutine({ username, password }).then(() => {
         this.$router.push('/')
       })
     }
    }
    ...


    Actually, what does
    mean const {username, password} = this ?
    Not strong in JS, and did not find it in the docks.
    JavaScript Ronan Dennis, Jan 20, 2020

  • 2 Answers
  • 0
    Destructuring
    Anonymous

  • 0
    This is destructuring. Learn js before diving into frameworks.
    Anonymous

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!