策略模式(Strategy) 定義:將定義的一組演算法封裝起來,使其相互之間可以替換。 ... if(type === 'add'){ return num1 + num2 } else if(type === 'subtract'){ ...
確定! 回上一頁