js比較或者篩選時不區分大小寫的實例解析

str.toUpperCase() str轉化成大寫

str.toLowerCase() str轉成小寫

例如:

product.name.toUpperCase().indexOf(this.props.filterText.toUpperCase())=== -1

都轉化成統一格式就可以進行比較瞭

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *