NickName:Jing Cheng Ask DateTime:2016-12-01T09:42:12 How to understand this slice()? What does the following slice do in javascript? str.slice(0, num > 3 ? num - 3 : num) Copyright Notice:Content Author:「Jing Cheng」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.Link to original article:https://stackoverflow.com/questions/40901268/how-to-understand-this-slice Answers