A
A
Alexander Shvedov2019-11-19 21:12:23
Vue.js
Alexander Shvedov, 2019-11-19 21:12:23

How to return the opposite bool type with a short entry?

How to make it so that the opposite type status is returned each time was true entered the function and became false saved then again entered the function was false became true

datas:{
                   TodayStatus:false,
                    TodayStatusfunc:function(){
                        console.log(!!this.datas.TodayStatus)
                        return !!this.this.datas.TodayStatus
                    }
                },
ошибка в том что он мне возвращает null постоянно

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Igor, 2019-11-19
@IgorPI

this.datas.TodayStatus = !this.datas.TodayStatus

N
Nikolai Chuprik, 2019-11-19
@choupa

The construction hurts the eye: this.this after return.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question