我试图在运行函数后将字符串存储到变量中。当它运行时,它返回未定义。在底部我尝试添加return marginDirection;
,但它仍然返回未定义。我不确定我哪里出错了。我在这一点上被卡住了。任何帮助,将不胜感激!谢谢
var marginDirection = getMarginDirection();
function getMarginDirection() {
if (floatDirection == 'right') {
marginDirection == 'left';
}
else if (floatDirection == 'left') {
marginDirection == 'right';
}
else {
marginDirection == '';
}
};