其他分享
首页 > 其他分享> > 2021-07-21

2021-07-21

作者:互联网

js输出斐波拉切数列 只输出一部分

<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script type="text/javascript">
			var x=0;
            var y=1;
            x=parseFloat(x);
            y=parseFloat(y);
            console.log(x);
            console.log(y);
            for(var i=1;i<=6;i++){
            	var t=x+y;
            	x=y;
            	y=t;
            	console.log(t);
            	
            }
		</script>
	</head>
	<body>
	</body>
</html>

标签:输出,console,07,21,parseFloat,2021,var,log
来源: https://blog.csdn.net/weixin_44103932/article/details/118973531