### 請實現一個js腳本，要求做到將數字轉化為千分位表示如：10000 轉化為10,000

10000  ---->   10,000

10000121213   ---->   10,000,121,213

`//法一function parseNum(num){	var list = new String(num).split('').reverse();	for(var i = 0; i < list.length; i++){		if(i % 4 == 3){			list.splice(i, 0, ',');		}	}	return list.reverse().join('');}console.log(parseNum(10000121213));//法二function parseNum(num){	var reg=/(?=(?!\b)(\d{3})+\$)/g;	return String(num).replace(reg, ',');}console.log(parseNum(10000121213));//法三String.prototype.strReverse = function(){	return this.split('').reverse().join('');}function parseNum(num){	var str_num = String(num);	var len = str_num.length;	var tail = str_num.slice(0, len % 3);	tail = tail.strReverse();	var reg=/\d{3}/g;	var list = str_num.strReverse().match(reg);	list.push(tail);	var res = list.join(',').strReverse();	return res;}console.log(parseNum(10000121213));//法四function parseNum(num){	var list = String(num).split('').reverse();	var temp = [];	for(var i = 0, len = list.length; i < len; i = i + 3){		temp.push(list.slice(i, i + 3).join(''));	}	return temp.join(',').split('').reverse().join('');}console.log(parseNum(10000121213));`