# setter(computed property)

# Ruby

attr_writer :name

# Swift

var name: String { get { return this.mName } set { this.mName = newValue } }

set の引数を省略すると newValue

var name: String { get { return this.mName } set(name) { this.mName = name } }

# TypeScript

set name(v: string) { this.mName = v; }

[ 📩 ご意見 ]