xxxxxxxxxx
function product() {
var advertiserId = 1234;
var ord = 543210;
var productId = "id1|id2|id3|id4".split("|");
var productName = "product1|product2|product3|product4".split("|");
var productItemPrice = "10|20|30|40".split("|");
var ret = [];
for(i = 0; i < productId.length; i++) {
ret.push(advertiserId+"|"+ord+"|"+productId[i]+"|"+productName[i]+"|"+productItemPrice[i]);
}
return ret;
}
let data = product();
console.log(data); // array holding the lines
// or join it with a newline
console.log(data.join("\n")); // lines as string
Run code snippet
xxxxxxxxxx
function product() {
var advertiserId = 1234;
var ord = 543210;
var productId = "id1|id2|id3|id4".split("|");
var productName = "product1|product2|product3|product4".split("|");
var productItemPrice = "10|20|30|40".split("|");
var ret = [];
for(i = 0; i < productId.length; i++) {
ret.push(advertiserId+"|"+ord+"|"+productId[i]+"|"+productName[i]+"|"+productItemPrice[i]);
}
return ret;
}
let data = product();
console.log(data); // array holding the lines
// or join it with a newline
console.log(data.join("\n")); // lines as string
Run code snippet
xxxxxxxxxx
function product() {
var advertiserId = 1234;
var ord = 543210;
var productId = "id1|id2|id3|id4".split("|");
var productName = "product1|product2|product3|product4".split("|");
var productItemPrice = "10|20|30|40".split("|");
var ret = [];
for(i = 0; i < productId.length; i++) {
ret.push(advertiserId+"|"+ord+"|"+productId[i]+"|"+productName[i]+"|"+productItemPrice[i]);
}
return ret;
}
let data = product();
console.log(data); // array holding the lines
// or join it with a newline
console.log(data.join("\n")); // lines as string
Run code snippet
xxxxxxxxxx
function product() {
var advertiserId = 1234;
var ord = 543210;
var productId = "id1|id2|id3|id4".split("|");
var productName = "product1|product2|product3|product4".split("|");
var productItemPrice = "10|20|30|40".split("|");
var ret = [];
for(i = 0; i < productId.length; i++) {
ret.push(advertiserId+"|"+ord+"|"+productId[i]+"|"+productName[i]+"|"+productItemPrice[i]);
}
return ret;
}
let data = product();
console.log(data); // array holding the lines
// or join it with a newline
console.log(data.join("\n")); // lines as string
Run code snippet
xxxxxxxxxx
function product() {
var advertiserId = 1234;
var ord = 543210;
var productId = "id1|id2|id3|id4".split("|");
var productName = "product1|product2|product3|product4".split("|");
var productItemPrice = "10|20|30|40".split("|");
var ret = [];
for(i = 0; i < productId.length; i++) {
ret.push(advertiserId+"|"+ord+"|"+productId[i]+"|"+productName[i]+"|"+productItemPrice[i]);
}
return ret;
}
let data = product();
console.log(data); // array holding the lines
// or join it with a newline
console.log(data.join("\n")); // lines as string
Run code snippet
xxxxxxxxxx
function product() {
var advertiserId = 1234;
var ord = 543210;
var productId = "id1|id2|id3|id4".split("|");
var productName = "product1|product2|product3|product4".split("|");
var productItemPrice = "10|20|30|40".split("|");
var ret = [];
for(i = 0; i < productId.length; i++) {
ret.push(advertiserId+"|"+ord+"|"+productId[i]+"|"+productName[i]+"|"+productItemPrice[i]);
}
return ret;
}
let data = product();
console.log(data); // array holding the lines
// or join it with a newline
console.log(data.join("\n")); // lines as string
Run code snippet
xxxxxxxxxx
function product() {
var advertiserId = 1234;
var ord = 543210;
var productId = "id1|id2|id3|id4".split("|");
var productName = "product1|product2|product3|product4".split("|");
var productItemPrice = "10|20|30|40".split("|");
var ret = [];
for(i = 0; i < productId.length; i++) {
ret.push(advertiserId+"|"+ord+"|"+productId[i]+"|"+productName[i]+"|"+productItemPrice[i]);
}
return ret;
}
let data = product();
console.log(data); // array holding the lines
// or join it with a newline
console.log(data.join("\n")); // lines as string
Run code snippet
xxxxxxxxxx
function product() {
var advertiserId = 1234;
var ord = 543210;
var productId = "id1|id2|id3|id4".split("|");
var productName = "product1|product2|product3|product4".split("|");
var productItemPrice = "10|20|30|40".split("|");
var ret = [];
for(i = 0; i < productId.length; i++) {
ret.push(advertiserId+"|"+ord+"|"+productId[i]+"|"+productName[i]+"|"+productItemPrice[i]);
}
return ret;
}
let data = product();
console.log(data); // array holding the lines
// or join it with a newline
console.log(data.join("\n")); // lines as string
Run code snippet
xxxxxxxxxx
function product() {
var advertiserId = 1234;
var ord = 543210;
var productId = "id1|id2|id3|id4".split("|");
var productName = "product1|product2|product3|product4".split("|");
var productItemPrice = "10|20|30|40".split("|");
var ret = [];
for(i = 0; i < productId.length; i++) {
ret.push(advertiserId+"|"+ord+"|"+productId[i]+"|"+productName[i]+"|"+productItemPrice[i]);
}
return ret;
}
let data = product();
console.log(data); // array holding the lines
// or join it with a newline
console.log(data.join("\n")); // lines as string
Run code snippet
xxxxxxxxxx
function product() {
var advertiserId = 1234;
var ord = 543210;
var productId = "id1|id2|id3|id4".split("|");
var productName = "product1|product2|product3|product4".split("|");
var productItemPrice = "10|20|30|40".split("|");
var ret = [];
for(i = 0; i < productId.length; i++) {
ret.push(advertiserId+"|"+ord+"|"+productId[i]+"|"+productName[i]+"|"+productItemPrice[i]);
}
return ret;
}
let data = product();
console.log(data); // array holding the lines
// or join it with a newline
console.log(data.join("\n")); // lines as string
Run code snippet