• 请不要在回答技术问题时复制粘贴 AI 生成的内容
TeslaM3
V2EX  ›  程序员

记录一坨代码

  •  
  •   TeslaM3 · Jul 16, 2024 · 1449 views
    This topic created in 687 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   ·   3429 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 11:11 · PVG 19:11 · LAX 04:11 · JFK 07:11
    ♥ Do have faith in what you're doing.