import{_ as n,c as s,a as t,o as p}from"./app-D1UhKcG3.js";const e={};function o(c,a){return p(),s("div",null,a[0]||(a[0]=[t(`

JavaScript函数

基本函数定义

function greeter(name)
{
	console.log("Hello, " + name);
}

调用函数greeter('Alice');

箭头方式定义函数

funcGreeter = (name) => {
	console.log("Hello, " + name);
}

如果只有一个参数的函数,可以省掉括号

name => {
	console.log("Hello, " + name);
}

如果函数体只包含一个返回语句,可以省略大括号

(a, b) => {
	return a+b;
}

//可以写成
(a, b) => a+b;
`,10)]))}const i=n(e,[["render",o],["__file","function.html.vue"]]),r=JSON.parse('{"path":"/note/language/javascript/function.html","title":"JavaScript函数","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"基本函数定义","slug":"基本函数定义","link":"#基本函数定义","children":[]},{"level":2,"title":"箭头方式定义函数","slug":"箭头方式定义函数","link":"#箭头方式定义函数","children":[]}],"git":{"updatedTime":1740235322000,"contributors":[{"name":"thejinchao","username":"thejinchao","email":"thejinchao@gmail.com","commits":1,"url":"https://github.com/thejinchao"}]},"filePathRelative":"note/language/javascript/function.md"}');export{i as comp,r as data};