Within my program, there is a loop that looks like the following-
this.storeData.StudentList.forEach(pStudent => {
studentName += pStudent.Name + '\n'
});
console.log(studentName);
array.push(studentName);
console.log(array);
When I print the 'studentName' variable, the new line character is being added correctly to the string. However, when I print the 'array', it displays as 'Student1\nStudent2\n'. What could be causing this issue? My environment uses typescript 3.1.6.