Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
変数/オブジェクトを変更して値を返すミューテーター メソッドを記述しても問題ありませんか? たとえば、並べ替えられた配列を返す並べ替えアルゴリズムを実装する関数は?
これはミューテーターメソッドと見なされますか?
これはミューテーターを記述する一般的な方法ではありませんが、更新された値を返すことを明確にしている限り、何も問題はありません。