ちょっと長い値の文字列のどこかで関数を呼び出すことができます。例を下に見てください。任意のアイデア - 私は、機能テスト()の呼び出しを追加するために、どこかのvar一時のdefintionで必要長い文字列のどこかで関数を呼び出す
function test() {
console.log('I am fine!')
}
var temp = 'hello..' + 'how do you feel?' + test() + 'something else'
私
var test2 = function test() {
console.log('I am fine!')
}
var temp = 'hello..' + 'how do you feel?' + test2 + 'something else'
ため、このもdidn't作品?
この質問の回答に編集してください。
function test() {
return 'I am fine!'
}
var temp = 'hello..' + 'how do you feel?' + test()
あなただけのことを確実にする必要があります。これは、あなたができるすべては、同様に、文字列に関数の結果を追加で何I'am多分これは他の誰か
function test() {
console.log('lorem1')
console.log('lorem2')
//.. do other stuff
return '\n'
}
var temp = 'lorem' + 'ipsum' + test() + 'something else'
値を返す必要があります。 'console.log'は値を返すだけです。 – shawon191
ああありがとう!!!! :) – t33n