Drkcore

25 02 2012 coffeescript Tweet

CoffeeScriptの文字列への変数埋め込み

なんというかjavascriptの感覚で文字列は+でつなげてしまう。使ったことなかったので調べた。

coffee> a = [1,2,3]
[ 1, 2, 3 ]
coffee> "ary #{a}"
'ary 1,2,3'
coffee> b = {a:'text'}
{ a: 'text' }
coffee> "dic #{b}"
'dic [object Object]'
coffee> "dic #{b.a}"
'dic text'

About

  • もう5年目(wishlistありマス♡)
  • 最近はPythonとDeepLearning
  • 日本酒自粛中
  • ドラムンベースからミニマルまで
  • ポケモンGOゆるめ

Tag

Python Deep Learning javascript chemoinformatics Emacs sake and more...

Ad

© kzfm 2003-2021