Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Doc O'Leary Newsgroups: comp.lang.javascript Subject: Re: How would you prepare for javascripting interview? Date: Sat, 23 Jul 2016 15:56:59 -0000 (UTC) Organization: Subsume Technologies, Inc. Lines: 23 Message-ID: References: <50e38667-93da-4c5d-bc02-a78394f0ca3b@googlegroups.com> <1875389.irdbgypaU6@PointedEars.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Date: Sat, 23 Jul 2016 15:56:59 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="35a2a0a28e4aa659e58d71f46ac8d861"; logging-data="14537"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19+cavL1TxHOxfVAlYttsmhJm9+3KTJH8k=" User-Agent: com.subsume.NNTP/1.0.0 Cancel-Lock: sha1:nlvWJmb4Kiw5+MmX742muKPpcoQ= Xref: csiph.com comp.lang.javascript:30967 For your reference, records indicate that Thomas 'PointedEars' Lahn wrote: > It makes sense for a minimum function to iterate over an argument list > starting with the highest possible value, and for a maximum function with > the lowest possible value. Not really. It makes very little sense to return a “valid” result as output that was not part of the input arguments. That’s certainly one, lazy way to define the function based on a convenient, number-centric implementation. For many other languages, min/max functions are often generically implemented on collections of comparable objects. On an empty list, they usually return a null object. What might also make sense is “undefined”, but not an opposite infinity. So would I get the job, or would you hire a more “agreeable” developer? :-) -- "Also . . . I can kill you with my brain." River Tam, Trash, Firefly