我想做一個函數,返回一些代碼,我正在努力這樣做。Javascript返回函數的語法
function getpresent (place) = {
type: "single-stim",
stimulus: getword(place),
is_html: true,
timing_stim: 250,
timing_response: 2000,
response_ends_trial: false,
};
這就是我現在所擁有的,但它不工作。我需要類似...
function getpresent (place) = {
RETURN [
type: "single-stim",
stimulus: getword(place),
is_html: true,
timing_stim: 250,
timing_response: 2000,
response_ends_trial: false,
],
};
這只是一個語法的東西?或者,我試圖做的只是根本上有缺陷?謝謝!
你幾乎有它。而不是'function getpresent(place)= {'try'function getpresent(place){return {'並用'}結束它' – Shanimal