I was inspired by my recent attempt at creating a parallel Mandelbrot generator for Minnow to learn some javascript and make a javascript version of it.
Here is an actual example of this code in use.
The javascript itself is pretty simple:
function point(t_x, t_y) { this.x = t_x; this.y = t_y; } function color(t_r, t_g, t_b) { this.r = t_r; this.g = t_g; this.b = t_b; } function get_color(t_point, t_center, t_width, t_height, t_scale) {
An interviewer who thinks he is being clever might present you with a code sample like the following and ask you what the output would be:
Recent comments
2 days 11 hours ago
2 days 11 hours ago
3 days 7 hours ago
1 week 1 day ago
1 week 1 day ago
2 weeks 22 hours ago
9 weeks 3 days ago
13 weeks 4 days ago
16 weeks 2 days ago
16 weeks 4 days ago