This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @file triangle 识别 | |
* @author shenli | |
* 原理可以参考:http://36kr.com/p/201751.html | |
*/ | |
var triangle = { | |
init: function (navContainer, navs) { | |
var me = this; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Verify that a given argument is a number | |
function isNumber(n){ | |
return !isNaN(parseFloat(n)) && isFinite(n); | |
} | |
// Get the max or the min in an array of numbers | |
var numbers = [5, 458 , 120 , -215 , 228 , 400 , 122205, -85411]; | |
var maxInNumbers = Math.max.apply(Math, numbers); | |
var minInNumbers = Math.min.apply(Math, numbers); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>BST</title> | |
</head> | |
<body> | |
<script> |