如何在Javascript中的console.log()中插入一个介绍(How to insert an intro in console.log() in Javascript)
我想用console.log()打印一些文本。 我有几行,每个我用过一个console.log()。 我想创建2个段落。 我怎么能这样做? 谢谢
console.log("1 : Lister les contacts"); //paragraph 1 console.log("2 : Ajouter un contact"); //paragraph 1 console.log("0 : Quitter"); //paragraph 1 console.log("Choisissez une option :")); //paragraph 2I would like to print some text using console.log(). I have several lines, a for each one I have used a console.log(). I would like to create 2 paragraphs. How could I do it? Thanks
console.log("1 : Lister les contacts"); //paragraph 1 console.log("2 : Ajouter un contact"); //paragraph 1 console.log("0 : Quitter"); //paragraph 1 console.log("Choisissez une option :")); //paragraph 2最满意答案
console.log("1 : Lister les contacts"); //paragraph 1 console.log("2 : Ajouter un contact"); //paragraph 1 console.log("0 : Quitter"); //paragraph 1 console.log(""); //paragraph 1 console.log("Choisissez une option :"); //paragraph 2或者,您可以使用\n打破这条线并使用两次\n\n来打破两条线:
console.log(" p1 Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. \n\n p2 Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. ");console.log("1 : Lister les contacts"); //paragraph 1 console.log("2 : Ajouter un contact"); //paragraph 1 console.log("0 : Quitter"); //paragraph 1 console.log(""); //paragraph 1 console.log("Choisissez une option :"); //paragraph 2Or you can use \n to break the line and use two time \n\n to break two line:
console.log(" p1 Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. \n\n p2 Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. ");
更多推荐
发布评论