我在表单中有 JSON 字符串
[
{
"couponcode": "HOMEV300JF",
"source": "a",
"description": "Rs 300 OFF on Home and Furniture section, on a minimum purchase of 1499 and above. Applicable on products..."
},
{
"couponcode": "MENSP10PMA",
"source": "a",
"description": "Upto 50% off + Add 10% off on Rs.999"
},
{
"couponcode": "MOVIE1000",
"source": "a",
"description": "Shop For Rs. 1999 & Above & Get 4 Movie Tickets Free Worth Rs. 1000 For Free"
},
{
"couponcode": "SALE15",
"source": "a",
"description": "Get upto 75% off + Additional 15% off on Rs.2499"
},
{
"couponcode": "SALE25",
"source": "a",
"description": "Get upto 75% off + Additional 25% off on Rs.2499"
}
]
我想将此 JSON (casperJS) 转换为一个对象,以便我可以像访问对象一样访问它
var length = object.length