What does <<-CONSTANT do?

前端 未结 3 882
渐次进展
渐次进展 2020-11-28 17:03
return <<-HTML
  
  • Link-Title
  • HTML

    What are <<-HTML on the first lin

    3条回答
    •  北荒
      北荒 (楼主)
      2020-11-28 17:22

      That's a here document. Basically, it's a multi-line string literal.

      On lines after the line with the <<-HTML, those are literal strings concatenated by newlines-- until the end marker is reached, which in this case is HTML.

    提交回复
    热议问题