Account for the formation of
$$
\mathrm{CH}_3 \mathrm{CH}=\mathrm{CH}-\mathrm{CH}_2 \mathrm{CN} \text { and }
$$
<smiles>C=CC(C)C#N</smiles>
from the reaction with $\mathrm{CN}^{-}$of 1 -chloro-2-butene, $\mathrm{CH}_3 \mathrm{CH}=\mathrm{CH}-\mathrm{CH}_2 \mathrm{Cl}$.
Formation of 1-cyano-2-butene results from $\mathrm{S}_{\mathrm{N}} 2$ reaction at the terminal $\mathrm{C}$.
$$
\mathrm{CH}_3-\mathrm{CH}=\mathrm{CH}^{-} \mathrm{CH}_2^{-}-\mathrm{Cl}^{-\mathrm{CN}^{-}} \longrightarrow \mathrm{CH}_3-\mathrm{CH}=\mathrm{CH}-\mathrm{CH}_2-\mathrm{CN}+\mathrm{Cl}^{-}
$$
Attack by $\mathrm{CN}^{-}$can also occur at $\mathrm{C}^3$ with the $\pi$ electrons of the double bond acting as nucleophile to displace $\mathrm{Cl}^{-}$in an allylic rearrangement: