need a little help with an exp system

Hello,
why not only do simply current xp = current xp + new xp won on each xp won and then with a var “level” check if current xp > to xp needed to new level (in an array where index is the level and value the xp value) with branch : true: level = new level ?