怎么保存this (self = this) 是最简单的写法

var self;
cc.Class({

    properties: () => ({
        length: 10,
    }),

    ctor: function () {
        self = this;
        ...
    },

    testA: function () {
        self.length = 9;
    },

    testB: function () {
        self.length = 11;
    },
});

是这么写么, 我想把self变成const, 但不知道怎么弄

this 不用保存,直接用就好了。
你这样保存有点像单例,虽然也是可以就是了。