Skip to content

Instantly share code, notes, and snippets.

@iketari
Created June 23, 2017 09:49
Show Gist options
  • Save iketari/0991422874c0a360d06bd4970daed753 to your computer and use it in GitHub Desktop.
Save iketari/0991422874c0a360d06bd4970daed753 to your computer and use it in GitHub Desktop.
JS Bin // source http://jsbin.com/xanoxi
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
/**
* Find min/max in an arbitrary line
* The sign of a number matters
* Unit tests are welcome
* @param {string} входные данные
* @returns {{min:number, max:number}} объект
*/
'use strict';
function getMinMax(string) {
// You should implement the body of this function
// ...
}
var inputData = '1, -5.8 or 10, but no 34 + -5.3 and 73';
var additionalData = '1,5;-5 1004 ha! 3.7';
console.log(getMinMax(inputData));
console.log(getMinMax(additionalData));
</script>
<script id="jsbin-source-javascript" type="text/javascript">/**
* Find min/max in an arbitrary line
* The sign of a number matters
* Unit tests are welcome
* @param {string} входные данные
* @returns {{min:number, max:number}} объект
*/
function getMinMax(string) {
// You should implement the body of this function
// ...
}
const inputData = '1, -5.8 or 10, but no 34 + -5.3 and 73';
const additionalData = '1,5;-5 1004 ha! 3.7';
console.log(getMinMax(inputData));
console.log(getMinMax(additionalData));
</script></body>
</html>
/**
* Find min/max in an arbitrary line
* The sign of a number matters
* Unit tests are welcome
* @param {string} входные данные
* @returns {{min:number, max:number}} объект
*/
'use strict';
function getMinMax(string) {
// You should implement the body of this function
// ...
}
var inputData = '1, -5.8 or 10, but no 34 + -5.3 and 73';
var additionalData = '1,5;-5 1004 ha! 3.7';
console.log(getMinMax(inputData));
console.log(getMinMax(additionalData));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment