V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
TeslaM3
V2EX  ›  程序员

记录一坨代码

  •  
  •   TeslaM3 · Jul 16, 2024 · 1393 views
    This topic created in 659 days ago, the information mentioned may be changed or developed.
    function test() {
    	console.log("Hello world!");
    }
     
    (function(){
        var box = function() {
            return box.fn.init();
        };
    
        box.prototype = box.fn = {
            init : function(){
                console.log('box.init()');
    
    			return this;
            },
    
    		add : function(str) {
    			alert("add", str);
    
    			return this;
    		},
    
    		remove : function(str) {
    			alert("remove", str);
    
    			return this;
    		}
        };
        
        box.fn.init.prototype = box.fn;
        
        window.box =box;
    })();
    
    var testBox = box();
    testBox.add("jQuery").remove("jQuery");
    
    bgm004
        1
    bgm004  
       Jul 17, 2024
    要是拿这个面试我,那我可过不了。
    TeslaM3
        2
    TeslaM3  
    OP
       Jul 17, 2024
    @Track13 你想笑死我,但是我没有证据
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   868 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 52ms · UTC 21:38 · PVG 05:38 · LAX 14:38 · JFK 17:38
    ♥ Do have faith in what you're doing.