1
私は配列を持っていますが、私は異なる値のために異なる配列を作りたいと思います。これは私の配列ですjavascriptを格納する配列
var data = [{
"rateType": "Fixed",
"interestRateMin": "12.0",
"imageUrl": "\/images\/dyn\/null.jpg",
"financingPercentageMax": "80",
"interestRateMax": "12.0",
"prePaymentCharge": "Nil",
"financingPercentageMin": "60",
"bankName": "Muthoot Finance",
"security": "Pledge of the gold ornaments and coins.",
"repaymentTenureInYears": "0.25",
"age": "35",
"processingFee": "Nil",
"maxLoanAmt": "10000000"
}, {
"rateType": "Floating",
"interestRateMin": "12.5",
"imageUrl": "\/images\/dyn\/94.jpg",
"financingPercentageMax": "90",
"interestRateMax": "12.5",
"prePaymentCharge": "DNA",
"financingPercentageMin": "75",
"bankName": "Federal Bank- Gold loan",
"security": "DNA",
"repaymentTenureInYears": "1",
"age": "35",
"processingFee": "DNA",
"maxLoanAmt": "7500000"
}, {
"rateType": "Floating",
"interestRateMin": "13.0",
"imageUrl": "\/images\/dyn\/155.jpg",
"financingPercentageMax": "80",
"interestRateMax": "13.0",
"prePaymentCharge": "DNA",
"financingPercentageMin": "80",
"bankName": "State Bank of Travancore- Liquid loan",
"security": "Pledge of gold ornaments",
"repaymentTenureInYears": "1",
"age": "35",
"processingFee": "DNA",
"maxLoanAmt": "1000000"
}, {
"rateType": "Floating",
"interestRateMin": "13.25",
"imageUrl": "\/images\/dyn\/151.jpg",
"financingPercentageMax": "80",
"interestRateMax": "13.25",
"prePaymentCharge": "DNA",
"financingPercentageMin": "80",
"bankName": "State Bank Of Hyderabad- Overdraft",
"security": "Pledge of Gold ornaments or Jewellery made of 22 Carat or 18 Carat",
"repaymentTenureInYears": "3",
"age": "35",
"processingFee": "1.10% of the original limit or max Rs 330",
"maxLoanAmt": "1500000"
}, {
"rateType": "Floating",
"interestRateMin": "14.5",
"imageUrl": "\/images\/dyn\/161.jpg",
"financingPercentageMax": "80",
"interestRateMax": "14.5",
"prePaymentCharge": "DNA",
"financingPercentageMin": "80",
"bankName": "Lakshmi Vilas Bank",
"security": "Pledge of gold ornaments",
"repaymentTenureInYears": "1",
"age": "35",
"processingFee": "0.50% of the limit sanctioned, min Rs 100",
"maxLoanAmt": "5000000"
}];
すべてのrateTypeを1つの配列に保存します。このように私は他の要素を格納するために別の配列を作成したい。誰かがあなたがdata
オブジェクトに(例えば)rateType
の配列を取得したい場合は、あなたがこれを行うことができ、この
この配列を反復処理し、[rateType]値で新しい配列を作成するにはどうすればよいですか? –
もっと説明できますか?新しい配列には何が含まれていますか? – cjohansson
['Array.prototype.filter()'](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)を使用してください。 – str