First
Examples
open all close allBasic Examples (5)
Extract the first element of a list:
First[{a, b, c}]Extract the first row of a matrix:
First[{{a, b}, {c, d}}]Extract the first element of an association:
First[<|1 -> a, 2 -> b|>]The head need not be List:
First[a ^ 2 + b ^ 2]Return x if there are zero elements:
First[{}, x]First[{a, b}, x]Generalizations & Extensions (2)
First works on SparseArray objects:
First[SparseArray[Range[100]]]First extracts the first value in an Association:
First[<|a -> x, b -> y|>]Properties & Relations (1)
First[expr] is equivalent to expr[[1]]:
First[{a, b, c}]{a, b, c}[[1]]Tech Notes
Related Guides
History
Introduced in 1988 (1.0) | Updated in 2014 (10.0) ▪ 2015 (10.3)
Text
Wolfram Research (1988), First, Wolfram Language function, https://reference.wolfram.com/language/ref/First.html (updated 2015).
CMS
Wolfram Language. 1988. "First." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2015. https://reference.wolfram.com/language/ref/First.html.
APA
Wolfram Language. (1988). First. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/First.html
BibTeX
@misc{reference.wolfram_2026_first, author="Wolfram Research", title="{First}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/First.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_first, organization={Wolfram Research}, title={First}, year={2015}, url={https://reference.wolfram.com/language/ref/First.html}, note=[Accessed: 13-June-2026]}