D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
chaseconey
Full window
Github gist
// source http://jsbin.com/wexegi
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>JS Bin</title> </head> <body> <script id="jsbin-javascript"> // The previous chapter introduced the standard function Math.min that returns its smallest argument. We can do that ourselves now. Write a function min that takes two arguments and returns their minimum. // Your code here. // console.log(min(0, 10)); // → 0 // console.log(min(0, -10)); // → -10 // URL: https://eloquentjavascript.net/03_functions.html#p_aW/Uoj4mDd function min(x, y) { if (x < y) { return x; } return y; } console.log(min(0, 10)); console.log(min(0, -10)); </script> <script id="jsbin-source-javascript" type="text/javascript">// The previous chapter introduced the standard function Math.min that returns its smallest argument. We can do that ourselves now. Write a function min that takes two arguments and returns their minimum. // Your code here. // console.log(min(0, 10)); // → 0 // console.log(min(0, -10)); // → -10 // URL: https://eloquentjavascript.net/03_functions.html#p_aW/Uoj4mDd function min(x, y) { if (x < y) { return x; } return y; } console.log(min(0, 10)); console.log(min(0, -10));</script></body> </html>