If you select 2 shields for 15% Scourge damage, then (1 +60%) * (1 +48% * 430%) = 4.90242. The registerForm.onsubmit function lacks flexibility. If we add a new validation rule or want to change the length validation of passwords from 6 to 8, we must change the code inside the registerForm.onsubmit function. Violating the open-closed principle.山芋也挨着板栗坐,板栗把玉米抱在怀里。杨长帆大概猜到了他的心思,安慰道:世伯,女人家的首饰,早晚还是要落到女人家手里。再苦再累,板栗相信家人都能挺过去,可是,玉米没了。The policy mode is the packaging of the algorithm, which separates the responsibility of using the algorithm from the algorithm itself and delegates it to different objects. Policy patterns usually wrap a series of algorithms into a series of policy classes. To encapsulate the policy pattern in one sentence is to "encapsulate each algorithm into a different policy class so that they can be interchanged". The following is the structure diagram of the policy mode: