# subtract

# Description

两数相减

# Params

(minuend, subtrahend)

# Return

number

# Depend

import createMathOperation from './.internal/createMathOperation.js'

createMathOperation 源码分析

# Code

const subtract = createMathOperation((minuend, subtrahend) => minuend - subtrahend, 0)

# Analyze

add 基本一致,方法改为了减法

# Remark

  1. Subtraction (-) (opens new window)

# Example

subtract(6, 4) // => 2